mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
20 lines
594 B
TypeScript
20 lines
594 B
TypeScript
import type { MigrationContext, ReversibleMigration } from '@db/types';
|
|
|
|
export class CreateVariables1677501636754 implements ReversibleMigration {
|
|
async up({ queryRunner, tablePrefix }: MigrationContext) {
|
|
await queryRunner.query(`
|
|
CREATE TABLE ${tablePrefix}variables (
|
|
id serial4 NOT NULL PRIMARY KEY,
|
|
"key" varchar(50) NOT NULL,
|
|
"type" varchar(50) NOT NULL DEFAULT 'string',
|
|
value varchar(255) NULL,
|
|
UNIQUE ("key")
|
|
);
|
|
`);
|
|
}
|
|
|
|
async down({ queryRunner, tablePrefix }: MigrationContext) {
|
|
await queryRunner.query(`DROP TABLE ${tablePrefix}variables;`);
|
|
}
|
|
}
|