Enforce uniqueness validations with unique indexes

From https://gitlab.com/gitlab-org/gitlab-ce/issues/35276#note_35964318:

If the Rails code validates it for uniqueness we definitely should add a unique index.

...

Rails validations are not atomic.

  • We should walk through all examples of uniqueness validations and add a unique index if appropriate
  • Add a test to enforce this for new uniqueness validations
Edited Jun 18, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading