diff options
Diffstat (limited to 'railties/lib/tasks/databases.rake')
-rw-r--r-- | railties/lib/tasks/databases.rake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index 0d4d658315..b00a789974 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -172,6 +172,13 @@ namespace :db do Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby end + desc 'Pushes the schema to the next version. Specify the number of steps with STEP=n' + task :forward => :environment do + step = ENV['STEP'] ? ENV['STEP'].to_i : 1 + ActiveRecord::Migrator.forward('db/migrate/', step) + Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby + end + desc 'Drops and recreates the database from db/schema.rb for the current environment and loads the seeds.' task :reset => [ 'db:drop', 'db:setup' ] |