Skip to content
Browse files

Added sequel:db:reset for dropping and remigrating database

  • Loading branch information...
1 parent fc0cea2 commit a8b3d0e578da2a1d5d332d5509e0256ec89f0337 @pusewicz pusewicz committed Jan 9, 2009
Showing with 6 additions and 0 deletions.
  1. +6 −0 merb_sequel/lib/merb_sequel/merbtasks.rb
View
6 merb_sequel/lib/merb_sequel/merbtasks.rb
@@ -13,6 +13,12 @@
task :migrate => :merb_start do
Sequel::Migrator.apply(Sequel::Model.db, "schema/migrations", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
end
+
+ desc "Drop all tables and perform migrations"
+ task :reset => :merb_start do
+ Sequel::Model.db.drop_table Sequel::Model.db.tables
+ Sequel::Migrator.apply(Sequel::Model.db, "schema/migrations", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
+ end
end

0 comments on commit a8b3d0e

Please sign in to comment.
Something went wrong with that request. Please try again.