sorting key support, clickhouse recreate table support

This commit is contained in:
Jan Prochazka
2024-09-12 11:59:03 +02:00
parent 670cfb9dc0
commit 2f1cbbd75e
8 changed files with 116 additions and 32 deletions

View File

@@ -11,6 +11,7 @@ import {
UniqueInfo,
SqlObjectInfo,
NamedObjectInfo,
ColumnsConstraintInfo,
} from '../../types';
export class DatabaseInfoAlterProcessor {
@@ -59,6 +60,9 @@ export class DatabaseInfoAlterProcessor {
case 'primaryKey':
table.primaryKey = constraint as PrimaryKeyInfo;
break;
case 'sortingKey':
table.sortingKey = constraint as ColumnsConstraintInfo;
break;
case 'foreignKey':
table.foreignKeys.push(constraint as ForeignKeyInfo);
break;
@@ -86,6 +90,9 @@ export class DatabaseInfoAlterProcessor {
case 'primaryKey':
table.primaryKey = null;
break;
case 'sortingKey':
table.sortingKey = null;
break;
case 'foreignKey':
table.foreignKeys = table.foreignKeys.filter(x => x.constraintName != constraint.constraintName);
break;