internal/store/migrations/0078_recent_id_order.up.sql

main
gitbay/internal/store/migrations/0078_recent_id_order.up.sql history · blame · raw

7 lines · 393 bytes

1-- The dashboard breaks updated_at ties by id, newest first. The 0035
2-- indexes carry rowid ascending after updated_at, so that order would
3-- sort the table instead of walking the index.
4DROP INDEX issues_recent;
5DROP INDEX merge_requests_recent;
6CREATE INDEX issues_recent ON issues(updated_at DESC, id DESC);
7CREATE INDEX merge_requests_recent ON merge_requests(updated_at DESC, id DESC);