-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReversibleMigration: remove_reference is not reversible. #604
Comments
Isn't it only reversible if it lists all the qualifiers as the I'm in doubt about adding |
@pirj isn't the same thing true of all the other reversible migration statements? For example, if I add a column with additional options, like add_column :comments, :position, :integer, default: 0 and then later remove that column without specifying those same options remove_column :comments, :position, :integer Then it won't properly rollback to its previous state. It will be missing the default. |
Fair enough 👍 |
@pirj sure, I can do it a few hours from now if you don't mind |
…bleMigration` This reverts commit 798b39e.
…ibleMigration` This reverts commit 798b39e. Remove `belongs_to` check from `Rails/ReversibleMigration`
…ibleMigration` This reverts commit 798b39e. Remove `belongs_to` and `remove_reference` checks from `Rails/ReversibleMigration`.
…ibleMigration` This reverts commit 798b39e. Remove `belongs_to` and `remove_reference` checks from `Rails/ReversibleMigration`.
…ibleMigration` This reverts commit 798b39e. Remove `belongs_to` and `remove_reference` checks from `Rails/ReversibleMigration`.
…ibleMigration` This reverts commit 798b39e. Remove `belongs_to` and `remove_reference` checks from `Rails/ReversibleMigration`.
…ibleMigration` This reverts commit 798b39e. Remove `belongs_to` and `remove_reference` checks from `Rails/ReversibleMigration`.
…erence [Fix #604] Remove `remove_reference` checks from `Rails/ReversibleMigration`
Behavior was introduced in: #592
Expected behavior
No warning for usage of
remove_reference
orremove_belongs_to
in a migration.As far as I can tell,
remove_reference
is reversible. Its inverse is available in ActiveRecord::Migration::CommandRecorder, and I'm able to rollback with it.Actual behavior
Receive the following warning:
Steps to reproduce the problem
Run
rubocop
on a migration that usesremove_reference
orremove_belongs_to
RuboCop version
The text was updated successfully, but these errors were encountered: