Rake remigrate
August 31st, 2006
Via errtheblog again! What a useful place
Here's a handy task to drop a database and remigrate it up to the current level. Put this in lib/tasks/foo.rake or something or other
RUBY:
-
desc "remotely console"
-
task :console, :roles => :app do
-
input = ''
-
run "cd #{current_path} && ./script/console #{ENV['RAILS_ENV']}" do |channel, stream, data|
-
next if data.chomp == input.chomp || data.chomp == ''
-
print data
-
channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/
-
end
-
end





Leave a Reply