Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added sequel:db:reset for dropping and remigrating database

  • Loading branch information...
commit a8b3d0e578da2a1d5d332d5509e0256ec89f0337 1 parent fc0cea2
@pusewicz pusewicz authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.