Fix for issue #3327 - may not solve issue with mariaDB but works for MySQL.

This commit is contained in:
mike12345567 2021-11-24 17:03:34 +00:00
parent 439c8cd3ef
commit 05a8b47db9
2 changed files with 5 additions and 1 deletions

View File

@ -38,6 +38,7 @@
const LINK_TYPE = FIELDS.LINK.type const LINK_TYPE = FIELDS.LINK.type
const STRING_TYPE = FIELDS.STRING.type const STRING_TYPE = FIELDS.STRING.type
const NUMBER_TYPE = FIELDS.NUMBER.type const NUMBER_TYPE = FIELDS.NUMBER.type
const DATE_TYPE = FIELDS.DATETIME.type
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
const PROHIBITED_COLUMN_NAMES = ["type", "_id", "_rev", "tableId"] const PROHIBITED_COLUMN_NAMES = ["type", "_id", "_rev", "tableId"]
@ -256,6 +257,9 @@
) { ) {
fieldToCheck.constraints.numericality = {} fieldToCheck.constraints.numericality = {}
} }
if (fieldToCheck.type === DATE_TYPE && !fieldToCheck.constraints.datetime) {
fieldToCheck.constraints.datetime = {}
}
} }
function checkErrors(fieldInfo) { function checkErrors(fieldInfo) {

View File

@ -134,7 +134,7 @@ module MySQLModule {
false false
) )
const tableNames = tablesResp.map( 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) { for (let tableName of tableNames) {
const primaryKeys = [] const primaryKeys = []