misskey-tools/migration/1599570288522-mypage.ts

19 lines
868 B
TypeScript
Raw Normal View History

2020-09-08 22:10:21 +09:00
import {MigrationInterface, QueryRunner} from 'typeorm';
export class mypage1599570288522 implements MigrationInterface {
2021-01-06 22:47:18 +09:00
name = 'mypage1599570288522'
2020-09-08 22:10:21 +09:00
2021-01-06 22:47:18 +09:00
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('CREATE TABLE "used_token" ("token" character varying NOT NULL, CONSTRAINT "PK_7f2db4c33c33cd6b38e63393fe5" PRIMARY KEY ("token"))');
await queryRunner.query('CREATE UNIQUE INDEX "IDX_7f2db4c33c33cd6b38e63393fe" ON "used_token" ("token") ');
await queryRunner.query('ALTER TABLE "user" ADD "misshaiToken" character varying NOT NULL DEFAULT \'\'');
}
2020-09-08 22:10:21 +09:00
2021-01-06 22:47:18 +09:00
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('ALTER TABLE "user" DROP COLUMN "misshaiToken"');
await queryRunner.query('DROP INDEX "IDX_7f2db4c33c33cd6b38e63393fe"');
await queryRunner.query('DROP TABLE "used_token"');
}
2020-09-08 22:10:21 +09:00
}