FIX: Support for `rake db:rollback` with plugins

For this to work we need to overwrite `db:rollback` in our Rakefile like
we do for migrate, so that it removes the load_config dependency. This
allows our custom migration paths to work.
This commit is contained in:
Robin Ward 2019-11-15 16:37:47 -05:00
parent eb4d8a43e3
commit 397852a9a6
1 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,13 @@ end
begin
Rake::Task["db:migrate"].clear
Rake::Task["db:rollback"].clear
end
task 'db:rollback' => ['environment', 'set_locale'] do |_, args|
step = ENV["STEP"] ? ENV["STEP"].to_i : 1
ActiveRecord::Base.connection.migration_context.rollback(step)
Rake::Task['db:_dump'].invoke
end
# we need to run seed_fu every time we run rake db:migrate