Repository navigation
feat(db): index a user's open tickets on SQLite too (migration 82) - #383
Ferdinand99 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Code graph out of date: Health delta baseline: last indexed commit a9ec8af (diverged from this PR's base — delta is approximate). Impact and hotspot numbers below may be wrong.
No verdict: the code graph is out of date. Static checks found no blocking issues, but they compared against an outdated graph. The next push after the repository re-indexes gets a full review.
Not checked: tests were not run; no formal proof of the changed code.
Graphify review — findings
Adds migration 82, which creates a partial index idx_tickets_user_open on tickets (user_id) covering only rows with status = 'open', so the DM ticket lookup can find one user's open tickets across servers without scanning the whole table. It uses CREATE INDEX IF NOT EXISTS, so re-running it is harmless, and it matches the index Postgres already creates in its bootstrap in db/tickets.js.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 22 functions depend on the 10 functions this change touches.
Health — grade A; 4 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
runBackup()— 5 callers, 11 callees (high)main()— 1 callers, 14 callees (high)startBackupSchedule()— 2 callers, 6 callees (medium)restoreFromBackup()— 1 callers, 8 callees (medium)
Verification — 22 functions in the blast radius were not formally verified this run (proofs are advisory here).
Health delta baseline: last indexed commit a9ec8af (diverged from this PR's base — delta is approximate).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 22 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
4 of 677 test file(s) selected (1%) via static blast radius.
test/backup.postgres.test.js— impacttest/backup.test.js— impacttest/pushEvents.test.js— impacttest/v2.permissionsBotWide.test.js— impact
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
Adds migration 82: the
idx_tickets_user_openindex on SQLite, so looking up a member's open tickets is indexed on both databases (Postgres already had it).Stacked on #368, which adds migration 81. Merge #368 first, then retarget this PR to
v5.3.Tested in the 5.3 combination build: SQLite 4087 passed / 0 failed, Postgres 4347 passed / 0 failed; migrations 81 and 82 apply on top of a 5.2 database.