diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 5eea636b5d..e2f000cf7e 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -190,6 +190,8 @@ jobs: docker pull mariadb@${{ steps.dotenv.outputs.MARIADB_SHA }} elif [ "${{ matrix.datasource }}" == "oracle" ]; then docker pull budibase/oracle-database:23.2-slim-faststart + elif [ "${{ matrix.datasource }}" == "postgres_legacy" ]; then + docker pull postgres:9.5.25 fi docker pull minio/minio & docker pull redis & diff --git a/packages/server/src/api/routes/tests/datasource.spec.ts b/packages/server/src/api/routes/tests/datasource.spec.ts index 514ed02c86..babb44b329 100644 --- a/packages/server/src/api/routes/tests/datasource.spec.ts +++ b/packages/server/src/api/routes/tests/datasource.spec.ts @@ -590,13 +590,13 @@ if (descriptions.length) { } const datasources = datasourceDescribe({ - exclude: [DatabaseName.MONGODB, DatabaseName.SQS, DatabaseName.ORACLE], + only: [DatabaseName.POSTGRES_LEGACY], }) if (datasources.length) { describe.each(datasources)( "$dbName", - ({ config, dsProvider, isPostgres, isMySQL, isMariaDB }) => { + ({ config, dsProvider, isPostgres, isLegacy, isMySQL, isMariaDB }) => { let datasource: Datasource let client: Knex @@ -647,6 +647,13 @@ if (datasources.length) { // can load it. We're using postgres 16 in tests at the time of writing. schema = schema.replace("SET transaction_timeout = 0;", "") } + if (isPostgres && isLegacy) { + // in older versions of Postgres, this is not a valid option - Postgres 9.5 does not support this. + schema = schema.replace( + "SET idle_in_transaction_session_timeout = 0;", + "" + ) + } await config.api.table.destroy(table._id!, table._rev!) diff --git a/packages/server/src/integrations/tests/utils/index.ts b/packages/server/src/integrations/tests/utils/index.ts index 00aff70b13..9e2c4f7e70 100644 --- a/packages/server/src/integrations/tests/utils/index.ts +++ b/packages/server/src/integrations/tests/utils/index.ts @@ -147,7 +147,11 @@ export function datasourceDescribe(opts: DatasourceDescribeOpts) { DatabaseName.ORACLE, ].includes(dbName), isMySQL: dbName === DatabaseName.MYSQL, - isPostgres: dbName === DatabaseName.POSTGRES, + isPostgres: + dbName === DatabaseName.POSTGRES || + dbName === DatabaseName.POSTGRES_LEGACY, + // check if any of the legacy tags + isLegacy: dbName === DatabaseName.POSTGRES_LEGACY, isMongodb: dbName === DatabaseName.MONGODB, isMSSQL: dbName === DatabaseName.SQL_SERVER, isOracle: dbName === DatabaseName.ORACLE,