1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #14048 from pcreux/better-error-message-db-migrate-down

Add hint to error message of task db:migrate:down
This commit is contained in:
Carlos Antonio da Silva 2014-02-14 12:01:26 -02:00
commit cdda29051a

View file

@ -75,7 +75,7 @@ db_namespace = namespace :db do
# desc 'Runs the "down" for a given migration VERSION.' # desc 'Runs the "down" for a given migration VERSION.'
task :down => [:environment, :load_config] do task :down => [:environment, :load_config] do
version = ENV['VERSION'] ? ENV['VERSION'].to_i : nil version = ENV['VERSION'] ? ENV['VERSION'].to_i : nil
raise 'VERSION is required' unless version raise 'VERSION is required - To go down one migration, run db:rollback' unless version
ActiveRecord::Migrator.run(:down, ActiveRecord::Migrator.migrations_paths, version) ActiveRecord::Migrator.run(:down, ActiveRecord::Migrator.migrations_paths, version)
db_namespace['_dump'].invoke db_namespace['_dump'].invoke
end end