mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-08-08 21:06:01 +02:00
20 lines
590 B
TypeScript
20 lines
590 B
TypeScript
import type { MigrationContext, ReversibleMigration } from '@/databases/types';
|
|
|
|
export class CreateVariables1677501636752 implements ReversibleMigration {
|
|
async up({ queryRunner, tablePrefix }: MigrationContext) {
|
|
await queryRunner.query(`
|
|
CREATE TABLE ${tablePrefix}variables (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
"key" TEXT NOT NULL,
|
|
"type" TEXT NOT NULL DEFAULT ('string'),
|
|
value TEXT,
|
|
UNIQUE("key")
|
|
);
|
|
`);
|
|
}
|
|
|
|
async down({ queryRunner, tablePrefix }: MigrationContext) {
|
|
await queryRunner.query(`DROP TABLE ${tablePrefix}variables;`);
|
|
}
|
|
}
|