grouped table recreates

This commit is contained in:
Jan Prochazka
2025-12-08 16:57:09 +01:00
parent 52dce7dfd3
commit 8d4178b984

View File

@@ -524,9 +524,22 @@ export class AlterPlan {
}
_groupTableRecreations(): AlterOperation[] {
return this.operations;
const res = [];
const recreates = new Set<string>();
for (const op of this.operations) {
if (op.operationType == 'recreateTable' && op.oldTable && op.newTable) {
const key = `${op.oldTable.schemaName}||${op.oldTable.pureName}`;
if (recreates.has(key)) {
// prevent duplicate recreates
continue;
}
recreates.add(key);
}
res.push(op);
}
return res;
// this is not implemented now
// const res = [];
// const recreates = {};
// for (const op of this.operations) {