From 2a388e14e39a155404cfa9c3458c168537c6d9f4 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 31 Jul 2013 14:56:16 -0400 Subject: [PATCH] Add rake task multisite:rollback --- vendor/gems/rails_multisite/lib/tasks/db.rake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vendor/gems/rails_multisite/lib/tasks/db.rake b/vendor/gems/rails_multisite/lib/tasks/db.rake index e436ea101dc..587ffcea222 100644 --- a/vendor/gems/rails_multisite/lib/tasks/db.rake +++ b/vendor/gems/rails_multisite/lib/tasks/db.rake @@ -18,3 +18,14 @@ task "multisite:seed_fu" => :environment do t.invoke end end + +desc "rollback migrations for all sites in tier" +task "multisite:rollback" => :environment do + RailsMultisite::ConnectionManagement.each_connection do |db| + puts "Rollback #{db}" + puts "---------------------------------\n" + t = Rake::Task["db:rollback"] + t.reenable + t.invoke + end +end