You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
change_column is not on the list of the migration definitions supported by the change method. This is easy to miss as there are a couple change_column_* methods that are supported.
When trying to rollback a migration that uses change_column in the change method, the following error will be displayed and the rollback will fail:
StandardError: An error has occurred, this and all later migrations canceled:
This migration uses change_column, which is not automatically reversible.
To make the migration reversible you can either:
1. Define #up and #down methods in place of the #change method.
2. Use the #reversible method to define reversible behavior.
Describe the solution you'd like
Add change_column to the ReversibleMigration cop.
Describe alternatives you've considered
Trying to remember this instead :)
Additional context
none
The text was updated successfully, but these errors were encountered:
mattmccormick
changed the title
Add change_column to ReversibleMigration
Add change_column to Rails/ReversibleMigrationDec 2, 2021
mattmccormick
added a commit
to mattmccormick/rubocop-rails
that referenced
this issue
Dec 2, 2021
…tion`
`change_column` is not on the list of the migration definitions supported by the `change` method. This is easy to miss as there are a couple `change_column_*` methods that are supported.
When trying to rollback a migration that uses `change_column` in the `change` method, the rollback will fail. This change adds the check to `Rails/ReversibleMigration`.
Is your feature request related to a problem? Please describe.
change_column
is not on the list of the migration definitions supported by thechange
method. This is easy to miss as there are a couplechange_column_*
methods that are supported.When trying to rollback a migration that uses
change_column
in thechange
method, the following error will be displayed and the rollback will fail:Describe the solution you'd like
Add
change_column
to the ReversibleMigration cop.Describe alternatives you've considered
Trying to remember this instead :)
Additional context
none
The text was updated successfully, but these errors were encountered: