n8n/packages/cli/src/databases/migrations/mysqldb/1652367743993-AddUserSettings.ts
कारतोफ्फेलस्क्रिप्ट™ 82fe6383ef
refactor(core): Delete boilerplate code across migrations (no-changelog) (#5254)
2023-05-05 11:28:59 +02:00

19 lines
662 B
TypeScript

import type { MigrationContext, ReversibleMigration } from '@db/types';
export class AddUserSettings1652367743993 implements ReversibleMigration {
async up({ queryRunner, tablePrefix }: MigrationContext) {
await queryRunner.query(
'ALTER TABLE `' + tablePrefix + 'user` ADD COLUMN `settings` json NULL DEFAULT NULL',
);
await queryRunner.query(
'ALTER TABLE `' +
tablePrefix +
'user` CHANGE COLUMN `personalizationAnswers` `personalizationAnswers` json NULL DEFAULT NULL',
);
}
async down({ queryRunner, tablePrefix }: MigrationContext) {
await queryRunner.query('ALTER TABLE `' + tablePrefix + 'user` DROP COLUMN `settings`');
}
}