mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 12:04:40 +08:00
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:
@ -50,6 +50,13 @@ end
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Rake::Task["db:migrate"].clear
|
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
|
end
|
||||||
|
|
||||||
# we need to run seed_fu every time we run rake db:migrate
|
# we need to run seed_fu every time we run rake db:migrate
|
||||||
|
Reference in New Issue
Block a user