Skip to content

Commit

Permalink
index with schema
Browse files Browse the repository at this point in the history
  • Loading branch information
guyb1 committed Sep 7, 2024
1 parent aeb3096 commit 1810d60
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib/domain/db-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ export const createTablesFromMetadata = ({
(pk) => pk.table === tableInfo.table
);

const tableIndexes = indexes.filter(
(idx) => idx.table === tableInfo.table
);
const tableIndexes = indexes.filter((idx) => {
const indexSchema =
(idx.schema ?? '').trim() === '' ? undefined : idx.schema;
return (
idx.table === tableInfo.table &&
indexSchema === tableInfo.schema
);
});

const fields: DBField[] = sortedColumns.map(
(col: ColumnInfo): DBField => ({
Expand Down

0 comments on commit 1810d60

Please sign in to comment.