mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-08 19:37:29 -08:00
15 lines
587 B
TypeScript
15 lines
587 B
TypeScript
import type { MigrationContext, ReversibleMigration } from '@db/types';
|
|
|
|
export class AddTriggerCountColumn1669823906994 implements ReversibleMigration {
|
|
async up({ queryRunner, tablePrefix }: MigrationContext) {
|
|
await queryRunner.query(
|
|
`ALTER TABLE ${tablePrefix}workflow_entity ADD COLUMN triggerCount integer NOT NULL DEFAULT 0`,
|
|
);
|
|
// Table will be populated by n8n startup - see ActiveWorkflowRunner.ts
|
|
}
|
|
|
|
async down({ queryRunner, tablePrefix }: MigrationContext) {
|
|
await queryRunner.query(`ALTER TABLE ${tablePrefix}workflow_entity DROP COLUMN triggerCount`);
|
|
}
|
|
}
|