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 = []