public
Description: All the extra stuff you could want for the Mack Framework.
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack-more.git
markbates (author)
Tue Aug 12 11:45:17 -0700 2008
commit  80324859b13764c03c7525a6811affbec0667381
tree    f8bcb2d741766ab537dbbdadf054375e371501d0
parent  5b2d5db9aeea49c0b4fe749a139b74c7f9cfb874
mack-more / mack-orm / lib / mack-orm / tasks / db_migration_tasks.rake
100644 18 lines (14 sloc) 0.616 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
namespace :db do
  
  desc "Migrate the database through scripts in db/migrations."
  task :migrate => "mack:environment" do
    Mack::Database::Migrations.migrate
  end # migrate
  
  desc "Rolls the schema back to the previous version. Specify the number of steps with STEP=n."
  task :rollback => ["mack:environment", "db:abort_if_pending_migrations"] do
    Mack::Database::Migrations.rollback((ENV["STEP"] || 1).to_i)
  end # rollback
  
  desc "Raises an error if there are pending migrations."
  task :abort_if_pending_migrations do
    Mack::Database::Migrations.abort_if_pending_migrations
  end
  
end # db