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
The migration should show the message about irreversibility but should be passed by and allowed to proceed with the schema dump.
Decide what to do with a migration being failed due to:
irreversible migration;
any other error.
What can it do:
skip and later just show info?
prevent from moving forward?
ask what to do from user?
should it be configurable?
Current output and behavior:
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.
/Users/andrei/projects/test/tmp/migrated/20240902112130_change_commitments_fields_from_integer_to_float.rb:4:in `block in change'
/Users/andrei/projects/test/tmp/migrated/20240902112130_change_commitments_fields_from_integer_to_float.rb:3:in `change'
Caused by:
ActiveRecord::IrreversibleMigration:
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.
/Users/andrei/projects/test/tmp/migrated/20240902112130_change_commitments_fields_from_integer_to_float.rb:4:in `block in change'
/Users/andrei/projects/test/tmp/migrated/20240902112130_change_commitments_fields_from_integer_to_float.rb:3:in `change'
Tasks: TOP => db:schema:dump => db:rollback_branches
(See full trace by running task with --trace)
stops right away. And that's annoying.
The text was updated successfully, but these errors were encountered:
(byebug) Rails.version
"6.1.7.6"
(byebug) error.message
"An error has occurred, this and all later migrations canceled:\n\n\n\nThis migration uses change_column, which is not automatically reversible.\nTo make the migration reversible you can either:\n1. Define #up and #down methods in place of the #change method.\n2. Use the #reversible method to define reversible behavior.\n\n\n"
(byebug) error.cause
#<ActiveRecord::IrreversibleMigration:
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.
(byebug) error.class
StandardError
(byebug) error.cause.class
ActiveRecord::IrreversibleMigration
The migration should show the message about irreversibility but should be passed by and allowed to proceed with the schema dump.
Decide what to do with a migration being failed due to:
What can it do:
Current output and behavior:
The text was updated successfully, but these errors were encountered: