mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 11:56:00 +00:00
clickhouse + mysql: modify table option
This commit is contained in:
@@ -425,6 +425,20 @@ function planAlterTable(plan: AlterPlan, oldTable: TableInfo, newTable: TableInf
|
||||
constraintPairs.filter(x => x[0] == null).forEach(x => plan.createConstraint(x[1]));
|
||||
|
||||
planTablePreload(plan, oldTable, newTable);
|
||||
|
||||
planChangeTableOptions(plan, oldTable, newTable, opts);
|
||||
}
|
||||
|
||||
function planChangeTableOptions(plan: AlterPlan, oldTable: TableInfo, newTable: TableInfo, opts: DbDiffOptions) {
|
||||
for(const option of plan.dialect?.getTableFormOptions?.('sqlAlterTable') || []) {
|
||||
if (option.disabled) {
|
||||
continue;
|
||||
}
|
||||
const name = option.name;
|
||||
if (oldTable[name] != newTable[name] && (oldTable[name]||newTable[name])) {
|
||||
plan.setTableOption(newTable, name, newTable[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function testEqualTables(
|
||||
|
||||
Reference in New Issue
Block a user