Created
July 22, 2016 04:53
-
-
Save kissrobber/8981f840bb088bc7aa5aa5e2e830da07 to your computer and use it in GitHub Desktop.
/lib/tasks/migrate_with_sql.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
desc 'Make migration with output' | |
namespace :migrate_with_sql do | |
task(:down => :environment) do | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
Rake::Task['db:migrate:down'].invoke | |
end | |
task(:up => :environment) do | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
Rake::Task['db:migrate:up'].invoke | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment