clickhouse: sorting key editor support

This commit is contained in:
Jan Prochazka
2024-09-11 16:53:11 +02:00
parent 33eed816aa
commit 575f8f23a7
9 changed files with 153 additions and 95 deletions

View File

@@ -5,7 +5,7 @@ export function addTableDependencies(db: DatabaseInfo): DatabaseInfo {
if (!db.tables) {
return db;
}
const allForeignKeys = _flatten(db.tables.map(x => x.foreignKeys || []));
return {
...db,
@@ -33,6 +33,14 @@ export function extendTableInfo(table: TableInfo): TableInfo {
constraintType: 'primaryKey',
}
: undefined,
sortingKey: table.sortingKey
? {
...table.sortingKey,
pureName: table.pureName,
schemaName: table.schemaName,
constraintType: 'sortingKey',
}
: undefined,
foreignKeys: (table.foreignKeys || []).map(cnt => ({
...cnt,
pureName: table.pureName,