Skip to content

Commit

Permalink
fix: getter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicGBauer committed Aug 28, 2024
1 parent 2a6a5b2 commit 9473cd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion packages/common/src/db/schema/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ export class Schema<S extends SchemaType = SchemaType> {

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;
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/db/schema/Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class Table<Columns extends ColumnsType = ColumnsType> {
}

get viewName() {
return this.viewNameOverride ?? this.name;
return this.viewNameOverride ? this.viewNameOverride : this.name;
}

get columns() {
Expand Down

0 comments on commit 9473cd6

Please sign in to comment.