diff --git a/packages/backend/migration/1718857094676-emojimore.js b/packages/backend/migration/1718857094676-emojimore.js new file mode 100644 index 0000000000..596b3242b9 --- /dev/null +++ b/packages/backend/migration/1718857094676-emojimore.js @@ -0,0 +1,16 @@ +export class Emojimore1718857094676 { + name = 'Emojimore1718857094676' + + async up(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_ad0c221b25672daf2df320a817"`); + await queryRunner.query(`CREATE INDEX "IDX_ad0c221b25672daf2df320a817" ON "note_reaction" ("userId", "noteId") `); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a7751b74317122d11575bff31c" ON "note_reaction" ("userId", "noteId", "reaction") `); + } + + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_a7751b74317122d11575bff31c"`); + await queryRunner.query(`DROP INDEX "public"."IDX_ad0c221b25672daf2df320a817"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ad0c221b25672daf2df320a817" ON "note_reaction" ("userId", "noteId") `); + + } +}