fix(core): All migrations should run in a transaction (#6519)
This commit is contained in:
committed by
GitHub
parent
ddfb24b325
commit
e152cfe27c
@@ -1,8 +1,6 @@
|
||||
import type { MigrationContext, ReversibleMigration } from '@db/types';
|
||||
|
||||
export class DeleteExecutionsWithWorkflows1673268682475 implements ReversibleMigration {
|
||||
transaction = false as const;
|
||||
|
||||
async up({ queryRunner, tablePrefix }: MigrationContext) {
|
||||
const workflowIds = (await queryRunner.query(`
|
||||
SELECT id FROM "${tablePrefix}workflow_entity"
|
||||
@@ -18,8 +16,6 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements ReversibleMig
|
||||
}`,
|
||||
);
|
||||
|
||||
await queryRunner.query('PRAGMA foreign_keys=OFF');
|
||||
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS "${tablePrefix}temporary_execution_entity"`);
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "${tablePrefix}temporary_execution_entity" (
|
||||
@@ -53,8 +49,6 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements ReversibleMig
|
||||
await queryRunner.query(
|
||||
`CREATE INDEX "IDX_${tablePrefix}ca4a71b47f28ac6ea88293a8e2" ON "${tablePrefix}execution_entity" ("waitTill")`,
|
||||
);
|
||||
|
||||
await queryRunner.query('PRAGMA foreign_keys=ON');
|
||||
}
|
||||
|
||||
async down({ queryRunner, tablePrefix }: MigrationContext) {
|
||||
|
||||
Reference in New Issue
Block a user