From 00fdc8986e99b9a1ea6556b3e0fc0df365b2246c Mon Sep 17 00:00:00 2001 From: Ferdinand99 Date: Mon, 16 Nov 2026 03:15:17 +0100 Subject: [PATCH] feat(db): index a user's open tickets on SQLite too (migration 82) --- src/db/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/db/index.js b/src/db/index.js index 8b4662bc..ae4cf63c 100644 --- a/src/db/index.js +++ b/src/db/index.js @@ -1620,6 +1620,11 @@ export const MIGRATIONS = [ ); `); }, + // 82: the open tickets of one user across servers (the DM ticket lookup asks for them first). Postgres + // creates the same index in its bootstrap (db/tickets.js). + (database) => { + database.exec(`CREATE INDEX IF NOT EXISTS idx_tickets_user_open ON tickets (user_id) WHERE status = 'open';`); + }, ]; /** Highest schema version this build knows how to run. */