Skip to content

Commit

Permalink
fix(migration): DBのマイグレーションの修正 (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid authored Jan 23, 2024
1 parent 65382dc commit 8092371
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/backend/migration/1705475608437-reversi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}
}
Original file line number Diff line number Diff line change
@@ -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"`);
}
}

0 comments on commit 8092371

Please sign in to comment.