From 406406328c094c49fb88ea1726dc164185f48067 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Tue, 6 May 2025 20:15:26 +0900 Subject: [PATCH] Fix 1745378064470-composite-note-index.js (#15968) --- .../backend/migration/1745378064470-composite-note-index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/migration/1745378064470-composite-note-index.js b/packages/backend/migration/1745378064470-composite-note-index.js index 1487aa9630..12108a6b3c 100644 --- a/packages/backend/migration/1745378064470-composite-note-index.js +++ b/packages/backend/migration/1745378064470-composite-note-index.js @@ -14,7 +14,7 @@ export class CompositeNoteIndex1745378064470 { if (concurrently) { const hasValidIndex = await queryRunner.query(`SELECT indisvalid FROM pg_index INNER JOIN pg_class ON pg_index.indexrelid = pg_class.oid WHERE pg_class.relname = 'IDX_724b311e6f883751f261ebe378'`); - if (!hasValidIndex || hasValidIndex[0].indisvalid !== true) { + if (hasValidIndex.length === 0 || hasValidIndex[0].indisvalid !== true) { await queryRunner.query(`DROP INDEX IF EXISTS "IDX_724b311e6f883751f261ebe378"`); await queryRunner.query(`CREATE INDEX CONCURRENTLY "IDX_724b311e6f883751f261ebe378" ON "note" ("userId", "id" DESC)`); }