Skip to content

Commit

Permalink
fixing typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Nov 27, 2024
1 parent bb30a53 commit 295fc9a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/drivers/postgres/postgres-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ WHERE

const tableKey = column.table_schema + "." + column.table_name;

if (tableRecord[tableKey]?.tableSchema) {
tableRecord[tableKey].tableSchema.columns.push(columnItem);
const tableSchema = tableRecord[tableKey].tableSchema;
if (tableSchema) {
tableSchema.columns.push(columnItem);
}
}

Expand Down Expand Up @@ -218,8 +219,9 @@ WHERE
}

constraintRecord[constraintKey] = constraintItem;
if (tableRecord[tableKey].tableSchema) {
tableRecord[tableKey].tableSchema.constraints = [
const tableSchema = tableRecord[tableKey]?.tableSchema;
if (tableSchema) {
tableSchema.constraints = [
...(tableRecord[tableKey].tableSchema?.constraints ?? []),
constraintItem,
];
Expand Down

0 comments on commit 295fc9a

Please sign in to comment.