mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
19 lines
843 B
TypeScript
19 lines
843 B
TypeScript
import type { MigrationContext, IrreversibleMigration } from '../migration-types';
|
|
|
|
export class MigrateExecutionStatus1676996103000 implements IrreversibleMigration {
|
|
async up({ queryRunner, tablePrefix }: MigrationContext) {
|
|
await queryRunner.query(
|
|
`UPDATE \`${tablePrefix}execution_entity\` SET status='waiting' WHERE status IS NULL AND \`waitTill\` IS NOT NULL;`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE \`${tablePrefix}execution_entity\` SET status='failed' WHERE status IS NULL AND finished=0 AND \`stoppedAt\` IS NOT NULL;`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE \`${tablePrefix}execution_entity\` SET status='success' WHERE status IS NULL AND finished=1 AND \`stoppedAt\` IS NOT NULL;`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE \`${tablePrefix}execution_entity\` SET status='crashed' WHERE status IS NULL;`,
|
|
);
|
|
}
|
|
}
|