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:
parent
eb4d8a43e3
commit
397852a9a6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue