drop table optimalization - dont drop references in mysql and slite

This commit is contained in:
Jan Prochazka
2021-09-13 21:00:49 +02:00
parent 02ce6b0204
commit 2fa48b1138
9 changed files with 67 additions and 12 deletions

View File

@@ -248,13 +248,15 @@ export class AlterPlan {
if (op.operationType == 'dropTable') {
return [
...(op.oldObject.dependencies || []).map(oldObject => {
const opRes: AlterOperation = {
operationType: 'dropConstraint',
oldObject,
};
return opRes;
}),
...(this.dialect.dropReferencesWhenDropTable
? (op.oldObject.dependencies || []).map(oldObject => {
const opRes: AlterOperation = {
operationType: 'dropConstraint',
oldObject,
};
return opRes;
})
: []),
op,
];
}