I am trying to run this migration on heroku, but it hangs at the loop.
puts "0"
add_column :batches, :store_id, :integer
add_column :batches, :company_id, :integer
puts "1"
for batch in Batch.all()
puts "2"
batch.company_id = batch.register.store.company.id.to_i
puts "3"
batch.store_id = batch.register.store.id.to_i
puts "4"
batch.save
puts "5"
end
puts "6"
Unfortunately, I can't tell exactly where it is hanging because none of my "puts" are being shown in console. The last line I get is:
-- add_column(:batches, :store_id, :integer)
I am not able to get any migrations with a loop working on heroku, but they all work fine locally, am I doing something wrong?
Output from heroku logs:
2011-06-20T13:58:15+00:00 app[rake.14]: Starting process with command `rake db:migrate --trace`
2011-06-20T13:58:48+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-06-20T13:58:48+00:00 app[web.1]: >> Stopping ...
2011-06-20T13:58:48+00:00 heroku[web.1]: Process exited