[Milestone N+1] Deduplicate and replace index with a unique index
This is step 2 of https://docs.gitlab.com/development/database/deduplicate_database_records/#deduplication-strategy-for-small-tables. ## Implementation guide 1. Implement the deduplication logic in a post-deployment migration by keeping the most recently updated record. 2. Replace the existing index with a unique index.
task