mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 03:26:00 +00:00
clickhouse: sorting key editor support
This commit is contained in:
@@ -266,6 +266,10 @@ export function editorDeleteConstraint(table: TableInfo, constraint: ConstraintI
|
||||
res.primaryKey = null;
|
||||
}
|
||||
|
||||
if (constraint.constraintType == 'sortingKey') {
|
||||
res.sortingKey = null;
|
||||
}
|
||||
|
||||
if (constraint.constraintType == 'foreignKey') {
|
||||
res.foreignKeys = table.foreignKeys.filter(x => x.pairingId != constraint.pairingId);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user