Files
n8n-enterprise-unlocked/packages/cli/src/databases/migrations/mysqldb/1677501636753-CreateVariables.ts
कारतोफ्फेलस्क्रिप्ट™ ab9835126e refactor(core): Use @/databases/ instead of @db/ (no-changelog) (#10573)
2024-08-27 17:24:20 +02:00

21 lines
640 B
TypeScript

import type { MigrationContext, ReversibleMigration } from '@/databases/types';
export class CreateVariables1677501636753 implements ReversibleMigration {
async up({ queryRunner, tablePrefix }: MigrationContext) {
await queryRunner.query(`
CREATE TABLE ${tablePrefix}variables (
id int(11) auto_increment NOT NULL PRIMARY KEY,
\`key\` VARCHAR(50) NOT NULL,
\`type\` VARCHAR(50) DEFAULT 'string' NOT NULL,
value VARCHAR(255) NULL,
UNIQUE (\`key\`)
)
ENGINE=InnoDB;
`);
}
async down({ queryRunner, tablePrefix }: MigrationContext) {
await queryRunner.query(`DROP TABLE ${tablePrefix}variables;`);
}
}