misskey-tools/migration/1599577510614-mode.ts

17 lines
643 B
TypeScript
Raw Normal View History

import {MigrationInterface, QueryRunner} from 'typeorm';
export class mode1599577510614 implements MigrationInterface {
2021-01-06 22:47:18 +09:00
name = 'mode1599577510614'
2021-01-06 22:47:18 +09:00
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('CREATE TYPE "user_alertmode_enum" AS ENUM(\'note\', \'notification\', \'nothing\')');
await queryRunner.query('ALTER TABLE "user" ADD "alertMode" "user_alertmode_enum" NOT NULL DEFAULT \'note\'');
}
2021-01-06 22:47:18 +09:00
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('ALTER TABLE "user" DROP COLUMN "alertMode"');
await queryRunner.query('DROP TYPE "user_alertmode_enum"');
}
}