rubocop/rubocop-rails

Please remove `Rails/UnusedIgnoredColumns`

rafaelfranca opened this issue · 1 comments

Is your feature request related to a problem? Please describe.

This cop was added in #494.

While the idea is good in practice it doesn't work. You should only delete the ignore_column when that column is removed from the production database, but if you have that cop enabled, it is using the development information to tell you that the column was already removed, which at that point you have no way to know yet.

This will cause the same pull request that removes the column from the database, to also remove it from the ignore_column list, negating the reason why you need to use ignore_column, and potentially causing downtime for systems.

Describe the solution you'd like

I don't see how to implement this cop is a way that would actually work since you need to have access to the production database schema to tell if a column was already removed or not, so I think this cop should be deprecated and removed.

@pocke did you find any case where you can safely know a column was already removed in production that made you implement this cop? As far as I know, checking schema.rb always will lead the cop to think the column was removed in the same pull request that just added ignore_column.