From 45b0223d306c6caf1d97566b8a36633f66696b25 Mon Sep 17 00:00:00 2001 From: naskya Date: Wed, 28 Feb 2024 23:21:04 +0900 Subject: [PATCH] fix (backend): incorrect database index Co-authored-by: sup39 --- neko/revert.sql | 1 + .../1709129810501-fix-note-url-index.js | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 packages/backend/migration-neko/1709129810501-fix-note-url-index.js diff --git a/neko/revert.sql b/neko/revert.sql index 729992b9..86ddff37 100644 --- a/neko/revert.sql +++ b/neko/revert.sql @@ -1,6 +1,7 @@ BEGIN; DELETE FROM "migrations" WHERE name IN ( + 'FixNoteUrlIndex1709129810501', 'IndexAltTextAndCw1708872574733', 'SeparateHardMuteWordsAndPatterns1706413792769', 'RenameMetaColumns1705944717480', diff --git a/packages/backend/migration-neko/1709129810501-fix-note-url-index.js b/packages/backend/migration-neko/1709129810501-fix-note-url-index.js new file mode 100644 index 00000000..3c13f653 --- /dev/null +++ b/packages/backend/migration-neko/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 */ + } +}