Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

index with schema

Guy Ben-Aharon1810d60f85a8
diff --git a/src/lib/domain/db-table.ts b/src/lib/domain/db-table.ts
index f4ba11d7..88be119f 100644
--- a/src/lib/domain/db-table.ts
+++ b/src/lib/domain/db-table.ts
@@ -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 => ({