This commit is contained in:
mike12345567 2021-07-05 18:16:04 +01:00
parent 4e4b8f244e
commit 6a8fd12805
2 changed files with 7 additions and 2 deletions

View File

@ -169,7 +169,10 @@ module MySQLModule {
const constraints = { const constraints = {
presence: column.Null !== "YES", presence: column.Null !== "YES",
} }
const isAuto: boolean = typeof column.Extra === "string" && (column.Extra === "auto_increment" || column.Extra.toLowerCase().includes("generated")) const isAuto: boolean =
typeof column.Extra === "string" &&
(column.Extra === "auto_increment" ||
column.Extra.toLowerCase().includes("generated"))
schema[columnName] = { schema[columnName] = {
name: columnName, name: columnName,
autocolumn: isAuto, autocolumn: isAuto,

View File

@ -184,7 +184,9 @@ module PostgresModule {
} }
const type: string = convertType(column.data_type, TYPE_MAP) const type: string = convertType(column.data_type, TYPE_MAP)
const isAuto: boolean = typeof column.column_default === "string" && column.column_default.startsWith("nextval") const isAuto: boolean =
typeof column.column_default === "string" &&
column.column_default.startsWith("nextval")
tables[tableName].schema[columnName] = { tables[tableName].schema[columnName] = {
autocolumn: isAuto, autocolumn: isAuto,
name: columnName, name: columnName,