From 05a8b47db9d979011ba77c8ce6fbc923e6ebc5c8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 24 Nov 2021 17:03:34 +0000 Subject: [PATCH] Fix for issue #3327 - may not solve issue with mariaDB but works for MySQL. --- .../backend/DataTable/modals/CreateEditColumn.svelte | 4 ++++ packages/server/src/integrations/mysql.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 0a640c5452..c47bf1a538 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -38,6 +38,7 @@ const LINK_TYPE = FIELDS.LINK.type const STRING_TYPE = FIELDS.STRING.type const NUMBER_TYPE = FIELDS.NUMBER.type + const DATE_TYPE = FIELDS.DATETIME.type const dispatch = createEventDispatcher() const PROHIBITED_COLUMN_NAMES = ["type", "_id", "_rev", "tableId"] @@ -256,6 +257,9 @@ ) { fieldToCheck.constraints.numericality = {} } + if (fieldToCheck.type === DATE_TYPE && !fieldToCheck.constraints.datetime) { + fieldToCheck.constraints.datetime = {} + } } function checkErrors(fieldInfo) { diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index a9b2b0efee..a870d2a3ae 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -134,7 +134,7 @@ module MySQLModule { false ) const tableNames = tablesResp.map( - (obj: any) => obj[`Tables_in_${database.toLowerCase()}`] + (obj: any) => obj[`Tables_in_${database}`] || obj[`Tables_in_${database.toLowerCase()}`] ) for (let tableName of tableNames) { const primaryKeys = []