This commit is contained in:
mike12345567 2021-07-05 18:16:04 +01:00
parent 8550d00751
commit b216c03e44
2 changed files with 7 additions and 2 deletions

View File

@ -169,7 +169,10 @@ module MySQLModule {
const constraints = {
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] = {
name: columnName,
autocolumn: isAuto,

View File

@ -184,7 +184,9 @@ module PostgresModule {
}
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] = {
autocolumn: isAuto,
name: columnName,