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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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`);
}
}

View File

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class UserProfileBirthdayIndex1706011243939 {
name = 'UserProfileBirthdayIndex1706011243939'
async up(queryRunner) {
await queryRunner.query(`CREATE INDEX "IDX_58699f75b9cf904f5f007909cb" ON "user_profile" ("birthday") `);
}
async down(queryRunner) {
await queryRunner.query(`DROP INDEX "public"."IDX_58699f75b9cf904f5f007909cb"`);
}
}