Files
vikunja/pkg/migration
kolaente 44d3540340 fix(migration): quote index identifiers so the swap works on postgres
Postgres folds unquoted identifiers to lowercase. `DROP INDEX IF EXISTS
IDX_tasks_done_due_date` therefore looked for `idx_tasks_done_due_date` and
silently matched nothing whenever the index carried the mixed-case name xorm
gives it, and the companion CREATE stored the new index under a lowercase name
that a later sync would not recognise, creating a second copy.

Both statements now go through the dialect quoter, with CREATE built by
`CreateIndexSQL` so the name matches what xorm derives from the struct tag.

v2.6.0's migration had the same bug, so on postgres the old index is actually
named `idx_tasks_done_due_date` there. Drop both spellings.

Also fixes the test helper, which called XName on index names DBMetas had
already returned in full and so compared against a double-prefixed
`IDX_tasks_idx_tasks_project_done_due_date`.
2026-09-04 10:32:56 +02:00
..