【发布时间】:2011-06-20 13:55:18
【问题描述】:
我正在尝试在 heroku 上运行此迁移,但它挂在循环中。
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"
不幸的是,我无法确切知道它挂在哪里,因为我的“放置”都没有显示在控制台中。我得到的最后一行是:
-- add_column(:batches, :store_id, :integer)
我无法通过在 heroku 上运行的循环进行任何迁移,但它们在本地都可以正常工作,我做错了什么吗?
heroku 日志的输出:
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
【问题讨论】:
标签: sql ruby-on-rails heroku rake