Rails应用程序在本地工作但不在Heroku上工作

时间:2016-01-12 17:42:02

标签: ruby-on-rails ruby-on-rails-3 heroku

我继承了在heroku上运行的rails应用程序。我需要添加一些我做过的数据库字段,它在本地工作。我向heroku部署了一个新版本,运行db:migrate,但由于某种原因它无法运行。它似乎认为这些字段不存在,但运行db:migrate:status我可以看到迁移已经运行:

> heroku run rake db:migrate:status
Running rake db:migrate:status attached to terminal... up, run.6278

database: **censored***

Status   Migration ID    Migration Name
--------------------------------------------------
up     20120107003506  Create conferences
up     20120112003506  Create users
up     20120116200332  Alter conferences country varchar
up     20120116213331  Alter conferences subject varchar
up     20120123215724  Split user name in two
up     20120123224808  Alter conferences add csv generated date
up     20120128211622  Increase conference text field size
up     20120128213531  Add indexes to conferences
up     20120131192147  Add role to user
up     20120131225950  Change subject to subject
up     20120209204719  Add status id to conferences
up     20120625221325  Add index to status
up     20120625225604  Add email sent to conferences
up     20120626231155  Rename email sent column
up     20120706141747  Set organiser emails to lowercase
up     20160112093201  Add conference type to conference
up     20160112142416  New fields

最后两次迁移是我的。 我还需要做点什么吗?

版本: 红宝石1.9.3 rails 3.2.3

1 个答案:

答案 0 :(得分:0)

您需要重新启动Dyno才能使迁移生效。从命令行:

heroku restart -a your_app_name