feat(migrations): add composite indexes to issue and issue_label #63
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!63
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/issue-composite-indexes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Addresses the Missing Composite Indexes item (SQL Handling, P1) of #19.
The upstream
issueandissue_labeltables only declare single-column indexes, so the hot issue-list query patterns cannot be served by one index:Approach: fork-safe
This lands as a fork-owned
codefloe_migrationsmigration (v9.go), not as edits to the upstream model structs. It touches no upstream file, so it cannot conflict with future upstream merges.x.Syncis additive: it creates the named composite indexes if missing and leaves every existing column and index untouched.Indexes created:
issue(repo_id, is_closed, created_unix)issue(repo_id, is_pull, is_closed)issue_label(issue_id, label_id)Verification
Test_AddIssueCompositeIndexesstarts from an upstream-shaped table (single-column indexes only), runs the migration, and asserts all three composite indexes exist; it also re-runs the sync to confirm idempotency.codefloe_migrationssuite green on sqlite.Closes the composite-index checkbox in #19.
5505acf9545de065ff265de065ff26848f84d9e1