Missing or Redundant Indexes in gprd
index_exists? falsely thinks an index exists
In !29507 (merged) we noticed an index should get removed, but it was already non-existing.
The index is not there. I would feel more comfortable to be able to test this
database-lab:
exec DROP INDEX CONCURRENTLY index_projects_on_creator_id_and_created_at; Session: joe-bqbbrk54h85u75aa3peg ERROR: pq: index "index_projects_on_creator_id_and_created_at" does not exist (edited) :x: 1
This index was added in 20200306193236_add_index_on_creator_id_and_created_at_to_projects
and was merged in !26686 (diffs).
We started digging, and Andreas guessed the index_exists?
check would not work correctly:
Is there a situation where the migration helper would think the index already exists but in reality it doesn't? There's another partial index on the same columns, but
index_exists?
used to support that.