gregnavis / active_record_doctor

Identify database issues before they hit production.
MIT License
1.76k stars 55 forks source link

Fix a false positive for `unindexed_foreign_keys` when having foreign key on a primary key column #157

Closed fatkodima closed 11 months ago

fatkodima commented 11 months ago

Fixes #156.

jdufresne commented 11 months ago

@fatkodima I discovered the same false positive exists for missing_unique_indexes.

add a unique index on children(parent_id) - using `has_one` in Parent without an index can lead to duplicates

The primary key index is already unique and so doesn't require an additional one.

Would you prefer I file a new issue or is this comment here sufficient?

fatkodima commented 11 months ago

This comment is sufficient, thanks.