From d30239b5e70dddc25427258942e6cc33f60127be Mon Sep 17 00:00:00 2001 From: naskya Date: Wed, 28 Feb 2024 23:28:09 +0900 Subject: [PATCH] fix (backend): incorrect database index Sorry for my silly mistake (cf. 9d56db0fbf 4356099fec) --- docs/downgrade.sql | 1 + .../migration/1709129810501-fix-note-url-index.js | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 packages/backend/migration/1709129810501-fix-note-url-index.js diff --git a/docs/downgrade.sql b/docs/downgrade.sql index f5ef5f20d0..7e04cf5b85 100644 --- a/docs/downgrade.sql +++ b/docs/downgrade.sql @@ -1,6 +1,7 @@ BEGIN; DELETE FROM "migrations" WHERE name IN ( + 'FixNoteUrlIndex1709129810501', 'RemoveCharts1709047957489', 'DropUserProfileLanguage1708452631156', 'EmojiModerator1692825433698', diff --git a/packages/backend/migration/1709129810501-fix-note-url-index.js b/packages/backend/migration/1709129810501-fix-note-url-index.js new file mode 100644 index 0000000000..3c13f65359 --- /dev/null +++ b/packages/backend/migration/1709129810501-fix-note-url-index.js @@ -0,0 +1,11 @@ +export class FixNoteUrlIndex1709129810501 { + name = "FixNoteUrlIndex1709129810501"; + + async up(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_note_url"`); + await queryRunner.query(`CREATE INDEX "IDX_note_url" ON "note" ("url")`); + } + async down(queryRunner) { + /* You don't revert this migration */ + } +}