When rolling back a migration that uses change instead of up and down methods, it is common to see a line like this:
create_view :my_schema, sql_definition: view_sql
The sql_definition parameter, which is needed for create_view is not needed for drop_view, when this migration is being reversed. At present, this parameter is still being passes, throwing an error.
Solution
Ignore the sql_definition parameter if it is passed to drop_view.
Problem
When rolling back a migration that uses
change
instead ofup
anddown
methods, it is common to see a line like this:The
sql_definition
parameter, which is needed forcreate_view
is not needed fordrop_view
, when this migration is being reversed. At present, this parameter is still being passes, throwing an error.Solution
Ignore the
sql_definition
parameter if it is passed todrop_view
.