MissingUniqueIndexChecker.md
March 7, 2026 ยท View on GitHub
Imagine your model has a validates :email, uniqueness: true validation but has no unique index in the database. As a general problem, your validation can be skipped or there are possible duplicates inserted because of race conditions. To keep your data consistent you should cover your validation with a unique index in the database (if possible). It will ensure you don't have duplicates.