clickhouse + mysql: modify table option

This commit is contained in:
Jan Prochazka
2024-09-11 15:09:16 +02:00
parent 7ad1950777
commit fb39cd1302
12 changed files with 88 additions and 21 deletions

View File

@@ -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(