mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 11:16:01 +00:00
sorting key support, clickhouse recreate table support
This commit is contained in:
@@ -284,6 +284,7 @@ export class AlterPlan {
|
||||
: [];
|
||||
const constraints = _.compact([
|
||||
dependencyDefinition?.includes('primaryKey') ? table.primaryKey : null,
|
||||
dependencyDefinition?.includes('sortingKey') ? table.sortingKey : null,
|
||||
...(dependencyDefinition?.includes('foreignKeys') ? table.foreignKeys : []),
|
||||
...(dependencyDefinition?.includes('indexes') ? table.indexes : []),
|
||||
...(dependencyDefinition?.includes('uniques') ? table.uniques : []),
|
||||
@@ -400,6 +401,7 @@ export class AlterPlan {
|
||||
|
||||
_canCreateConstraint(cnt: ConstraintInfo) {
|
||||
if (cnt.constraintType == 'primaryKey') return this.dialect.createPrimaryKey;
|
||||
if (cnt.constraintType == 'sortingKey') return this.dialect.createPrimaryKey;
|
||||
if (cnt.constraintType == 'foreignKey') return this.dialect.createForeignKey;
|
||||
if (cnt.constraintType == 'index') return this.dialect.createIndex;
|
||||
if (cnt.constraintType == 'unique') return this.dialect.createUnique;
|
||||
@@ -409,6 +411,7 @@ export class AlterPlan {
|
||||
|
||||
_canDropConstraint(cnt: ConstraintInfo) {
|
||||
if (cnt.constraintType == 'primaryKey') return this.dialect.dropPrimaryKey;
|
||||
if (cnt.constraintType == 'sortingKey') return this.dialect.dropPrimaryKey;
|
||||
if (cnt.constraintType == 'foreignKey') return this.dialect.dropForeignKey;
|
||||
if (cnt.constraintType == 'index') return this.dialect.dropIndex;
|
||||
if (cnt.constraintType == 'unique') return this.dialect.dropUnique;
|
||||
|
||||
Reference in New Issue
Block a user