This commit is contained in:
Jan Prochazka
2021-12-09 18:43:11 +01:00
parent 1a0d5457ce
commit 4dae581438

View File

@@ -7,6 +7,7 @@ export interface ColumnInfoYaml {
name: string; name: string;
type: string; type: string;
notNull?: boolean; notNull?: boolean;
length?: number;
autoIncrement?: boolean; autoIncrement?: boolean;
references?: string; references?: string;
primaryKey?: boolean; primaryKey?: boolean;
@@ -67,7 +68,7 @@ function columnInfoFromYaml(column: ColumnInfoYaml, table: TableInfoYaml): Colum
const res: ColumnInfo = { const res: ColumnInfo = {
pureName: table.name, pureName: table.name,
columnName: column.name, columnName: column.name,
dataType: column.type, dataType: column.length ? `${column.type}(${column.length})` : column.type,
autoIncrement: column.autoIncrement, autoIncrement: column.autoIncrement,
notNull: column.notNull || (table.primaryKey && table.primaryKey.includes(column.name)), notNull: column.notNull || (table.primaryKey && table.primaryKey.includes(column.name)),
}; };