From a451b6eb3c387a90822633cd9a798860e561ff3a Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 6 Aug 2024 09:58:02 +0100 Subject: [PATCH 1/2] Add Oracle to datasource.spec.ts. --- .../server/src/api/routes/tests/datasource.spec.ts | 10 ++-------- packages/server/src/integrations/oracle.ts | 4 +++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/server/src/api/routes/tests/datasource.spec.ts b/packages/server/src/api/routes/tests/datasource.spec.ts index 4ca766247b..127ebaa6ae 100644 --- a/packages/server/src/api/routes/tests/datasource.spec.ts +++ b/packages/server/src/api/routes/tests/datasource.spec.ts @@ -164,6 +164,7 @@ describe("/datasources", () => { [DatabaseName.MYSQL, getDatasource(DatabaseName.MYSQL)], [DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)], [DatabaseName.MARIADB, getDatasource(DatabaseName.MARIADB)], + [DatabaseName.ORACLE, getDatasource(DatabaseName.ORACLE)], ])("%s", (_, dsProvider) => { let rawDatasource: Datasource beforeEach(async () => { @@ -285,9 +286,6 @@ describe("/datasources", () => { [FieldType.STRING]: { name: stringName, type: FieldType.STRING, - constraints: { - presence: true, - }, }, [FieldType.LONGFORM]: { name: "longform", @@ -381,10 +379,6 @@ describe("/datasources", () => { ), schema: Object.entries(table.schema).reduce( (acc, [fieldName, field]) => { - // the constraint will be unset - as the DB doesn't recognise it as not null - if (fieldName === stringName) { - field.constraints = {} - } acc[fieldName] = expect.objectContaining({ ...field, }) @@ -441,7 +435,7 @@ describe("/datasources", () => { }) describe("info", () => { - it("should fetch information about postgres datasource", async () => { + it("should fetch information about a datasource", async () => { const table = await config.api.table.save( tableForDatasource(datasource, { schema: { diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index d1c0978b89..545cbf40f6 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -400,7 +400,9 @@ class OracleIntegration extends Sql implements DatasourcePlus { if (oracleConstraint.type === OracleContraintTypes.PRIMARY) { table.primary!.push(columnName) } else if ( - oracleConstraint.type === OracleContraintTypes.NOT_NULL_OR_CHECK + oracleConstraint.type === + OracleContraintTypes.NOT_NULL_OR_CHECK && + oracleConstraint.searchCondition?.endsWith("IS NOT NULL") ) { table.schema[columnName].constraints = { presence: true, From 589909c3a29253d44c98684495ca764402d0f571 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 6 Aug 2024 14:35:23 +0100 Subject: [PATCH 2/2] Bump up the packages/server test runners. --- .github/workflows/budibase_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index a17ca352cc..1b236caab5 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -147,7 +147,7 @@ jobs: fi test-server: - runs-on: budi-tubby-tornado-quad-core-150gb + runs-on: budi-tubby-tornado-quad-core-300gb steps: - name: Checkout repo uses: actions/checkout@v4