diff --git a/packages/backend/migration/1731898598469-addBlockingReactionUser.js b/packages/backend/migration/1731898598469-addBlockingReactionUser.js deleted file mode 100644 index 6cf9d4ca87..0000000000 --- a/packages/backend/migration/1731898598469-addBlockingReactionUser.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class AddBlockingReactionUser1731898598469 { - name = 'AddBlockingReactionUser1731898598469' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "blocking" ADD "isReactionBlock" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."isReactionBlock" IS 'Whether the blockee is a reaction block.'`); - await queryRunner.query(`CREATE INDEX "IDX_7b0698c38d27a5554bed4858bd" ON "blocking" ("isReactionBlock") `); - } - - async down(queryRunner) { - await queryRunner.query(`DELETE FROM blocking WHERE "isReactionBlock" = 'true'`); // blockingテーブルのisReactionBlockカラムがtrueの行を削除する - await queryRunner.query(`DROP INDEX "IDX_7b0698c38d27a5554bed4858bd"`); - await queryRunner.query(`ALTER TABLE "blocking" DROP COLUMN "isReactionBlock"`); - } -} diff --git a/packages/backend/migration/1731932268436-addBlockingReactionUser.js b/packages/backend/migration/1731932268436-addBlockingReactionUser.js new file mode 100644 index 0000000000..62033fb434 --- /dev/null +++ b/packages/backend/migration/1731932268436-addBlockingReactionUser.js @@ -0,0 +1,16 @@ +export class AddBlockingReactionUser1731932268436 { + name = 'AddBlockingReactionUser1731932268436' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "blocking" ADD "blockType" character varying NOT NULL DEFAULT 'user'`); + await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockType" IS 'Block type.'`); + await queryRunner.query(`CREATE INDEX "IDX_cd38e7ea08163899a2d1f4427d" ON "blocking" ("blockType") `); + } + + async down(queryRunner) { + await queryRunner.query(`DELETE FROM blocking WHERE "blockType" = 'reaction'`); // blockingテーブルのblockTypeがreactionの行を削除 + await queryRunner.query(`DROP INDEX "public"."IDX_cd38e7ea08163899a2d1f4427d"`); + await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockType" IS 'Block type.'`); + await queryRunner.query(`ALTER TABLE "blocking" DROP COLUMN "blockType"`); + } +}