diff --git a/packages/common/src/db/schema/Schema.ts b/packages/common/src/db/schema/Schema.ts index a8650cb4..6ab4ce54 100644 --- a/packages/common/src/db/schema/Schema.ts +++ b/packages/common/src/db/schema/Schema.ts @@ -41,7 +41,14 @@ export class Schema { private convertToClassicTables(props: S) { return Object.entries(props).map(([name, table]) => { - const convertedTable = Table.createTable(name, table); + const convertedTable = new Table({ + name, + columns: table.columns, + indexes: table.indexes, + localOnly: table.localOnly, + insertOnly: table.insertOnly, + viewName: table.viewName + }); return convertedTable; }); } diff --git a/packages/common/src/db/schema/Table.ts b/packages/common/src/db/schema/Table.ts index 1ecea293..5d9c3390 100644 --- a/packages/common/src/db/schema/Table.ts +++ b/packages/common/src/db/schema/Table.ts @@ -190,7 +190,7 @@ export class Table { } get viewName() { - return this.viewNameOverride ?? this.name; + return this.viewNameOverride ? this.viewNameOverride : this.name; } get columns() {