diff --git a/integration-tests/__tests__/alter-table.spec.js b/integration-tests/__tests__/alter-table.spec.js index 2daf16730..cb8c198f4 100644 --- a/integration-tests/__tests__/alter-table.spec.js +++ b/integration-tests/__tests__/alter-table.spec.js @@ -119,6 +119,7 @@ async function testTableDiff(engine, conn, driver, mangle, changedTable = 't1') const TESTED_COLUMNS = ['col_pk', 'col_std', 'col_def', 'col_fk', 'col_ref', 'col_idx', 'col_uq']; // const TESTED_COLUMNS = ['col_pk']; +// const TESTED_COLUMNS = ['col_fk']; // const TESTED_COLUMNS = ['col_idx']; // const TESTED_COLUMNS = ['col_def']; // const TESTED_COLUMNS = ['col_std']; diff --git a/packages/tools/src/alterPlan.ts b/packages/tools/src/alterPlan.ts index 5462efab8..1143ff165 100644 --- a/packages/tools/src/alterPlan.ts +++ b/packages/tools/src/alterPlan.ts @@ -337,7 +337,13 @@ export class AlterPlan { return opRes; }), op, - ]; + ].filter(op => { + // filter duplicated drops + const existingDrop = this.operations.find( + o => o.operationType == 'dropConstraint' && o.oldObject === op['oldObject'] + ); + return existingDrop == null; + }); return res; }