mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 07:03:59 +00:00
grouped table recreates
This commit is contained in:
@@ -524,9 +524,22 @@ export class AlterPlan {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_groupTableRecreations(): AlterOperation[] {
|
_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 res = [];
|
||||||
// const recreates = {};
|
// const recreates = {};
|
||||||
// for (const op of this.operations) {
|
// for (const op of this.operations) {
|
||||||
|
|||||||
Reference in New Issue
Block a user