mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
16 lines
619 B
TypeScript
16 lines
619 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`);
|
|
|
|
await queryRunner.query(
|
|
`ALTER TABLE "${tablePrefix}user" ALTER COLUMN "personalizationAnswers" TYPE json USING to_jsonb("personalizationAnswers")::json;`,
|
|
);
|
|
}
|
|
|
|
async down({ queryRunner, tablePrefix }: MigrationContext) {
|
|
await queryRunner.query(`ALTER TABLE "${tablePrefix}user" DROP COLUMN settings`);
|
|
}
|
|
}
|