fix(migration): DBのマイグレーションの修正 (MisskeyIO#375)

This commit is contained in:
まっちゃとーにゅ
2024-01-23 21:15:23 +09:00
committed by GitHub
parent 65382dc70b
commit 80923710ec
2 changed files with 18 additions and 8 deletions

View File

@@ -7,16 +7,10 @@ export class Reversi1705475608437 {
name = 'Reversi1705475608437'
async up(queryRunner) {
// await queryRunner.query(`DROP INDEX "public"."IDX_b46ec40746efceac604142be1c"`);
// await queryRunner.query(`DROP INDEX "public"."IDX_b604d92d6c7aec38627f6eaf16"`);
// await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "createdAt"`);
// await queryRunner.query(`ALTER TABLE "reversi_matching" DROP COLUMN "createdAt"`);
await queryRunner.query(`ALTER TABLE "reversi_game" ALTER COLUMN "createdAt" SET DEFAULT now()`);
}
async down(queryRunner) {
// await queryRunner.query(`ALTER TABLE "reversi_matching" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`);
// await queryRunner.query(`ALTER TABLE "reversi_game" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`);
// await queryRunner.query(`CREATE INDEX "IDX_b604d92d6c7aec38627f6eaf16" ON "reversi_matching" ("createdAt") `);
// await queryRunner.query(`CREATE INDEX "IDX_b46ec40746efceac604142be1c" ON "reversi_game" ("createdAt") `);
await queryRunner.query(`ALTER TABLE "reversi_game" ALTER COLUMN "createdAt" DROP DEFAULT`);
}
}