gregnavis / active_record_doctor

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

Fix ignoring columns from `has_one` association for `missing_unique_indexes` #137

Closed fatkodima closed 2 months ago

fatkodima commented 1 year ago
class User
  has_one :account
end

class Account
end

To disable missing_unique_indexes for checking unique index on accounts.user_id, we currently should add ignore_columns: ["User(user_id)"] to the config, which does not make sense. This PR fixes that so we should write as ignore_columns: ["Account(user_id)"].

gregnavis commented 2 months ago

@fatkodima, could you rebase the PR?

fatkodima commented 2 months ago

Rebased. Turns out, the code change is not needed now, only the test that is useful.

gregnavis commented 2 months ago

@fatkodima, interesting! Do you happen to know why the issue is gone now?

gregnavis commented 2 months ago

@fatkodima, the linter is failing.

fatkodima commented 2 months ago

This was fixed in https://github.com/gregnavis/active_record_doctor/commit/b013fc06c917254c4679fc044721efad1477dd33 🤷

Somehow this PR is a duplicate. We need to merge PRs faster 😅