mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 06:26:00 +00:00
option allowEmptyValue flag
This commit is contained in:
@@ -435,7 +435,11 @@ function planChangeTableOptions(plan: AlterPlan, oldTable: TableInfo, newTable:
|
||||
continue;
|
||||
}
|
||||
const name = option.name;
|
||||
if (oldTable[name] != newTable[name] && (oldTable[name] || newTable[name])) {
|
||||
if (
|
||||
oldTable[name] != newTable[name] &&
|
||||
(oldTable[name] || newTable[name]) &&
|
||||
(newTable[name] || option.allowEmptyValue)
|
||||
) {
|
||||
plan.setTableOption(newTable, name, newTable[name]);
|
||||
}
|
||||
}
|
||||
|
||||
1
packages/types/dialect.d.ts
vendored
1
packages/types/dialect.d.ts
vendored
@@ -54,5 +54,6 @@ export interface SqlDialect {
|
||||
name: string;
|
||||
sqlFormatString: string;
|
||||
disabled?: boolean;
|
||||
allowEmptyValue?: boolean;
|
||||
}[];
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ const dialect = {
|
||||
label: 'Comment',
|
||||
name: 'objectComment',
|
||||
sqlFormatString: '^comment %v',
|
||||
allowEmptyValue: true,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
@@ -118,6 +118,7 @@ const dialect = {
|
||||
label: 'Comment',
|
||||
name: 'objectComment',
|
||||
sqlFormatString: '^comment = %v',
|
||||
allowEmptyValue: true,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user