From 7af7f1c175d796e45af55649cdf779fcfacaf23e Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 14 Oct 2023 21:09:47 +0200 Subject: [PATCH] [backend] Make constraint creations in ResyncWithOrm migration idempotent too --- .../backend/src/migration/1697289658422-resync-with-orm.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/backend/src/migration/1697289658422-resync-with-orm.ts b/packages/backend/src/migration/1697289658422-resync-with-orm.ts index 4b4729fa3..aca3d8af7 100644 --- a/packages/backend/src/migration/1697289658422-resync-with-orm.ts +++ b/packages/backend/src/migration/1697289658422-resync-with-orm.ts @@ -36,6 +36,9 @@ export class ResyncWithOrm1697289658422 implements MigrationInterface { await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT IF EXISTS "UQ_51cb79b5555effaf7d69ba1cff9"`); await queryRunner.query(`ALTER TABLE "promo_note" DROP CONSTRAINT IF EXISTS "FK_e263909ca4fe5d57f8d4230dd5c"`); await queryRunner.query(`ALTER TABLE "promo_note" DROP CONSTRAINT IF EXISTS "UQ_e263909ca4fe5d57f8d4230dd5c"`); + await queryRunner.query(`ALTER TABLE "renote_muting" DROP CONSTRAINT IF EXISTS "FK_7eac97594bcac5ffcf2068089b6"`); + await queryRunner.query(`ALTER TABLE "renote_muting" DROP CONSTRAINT IF EXISTS "FK_7aa72a5fe76019bfe8e5e0e8b7d"`); + await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP CONSTRAINT IF EXISTS "FK_a9021cc2e1feb5f72d3db6e9f5f"`); await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_d1259a2c2b7bb413ff449e8711" ON "renote_muting" ("createdAt") `); await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_7eac97594bcac5ffcf2068089b" ON "renote_muting" ("muteeId") `); await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_7aa72a5fe76019bfe8e5e0e8b7" ON "renote_muting" ("muterId") `);