Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"`);
}
}
Loading