帮助!!Heroku run rake db:migrate not working
我想把我的生产代码推到heroku,但由于某种原因,heroku运行rake db:migrate命令不起作用。它给我这个错误:
Migrating to RemoveMealPlanFromOrders (20150125085531)
== 20150125085531 RemoveMealPlanFromOrders: migrating =========================
-- remove_reference(:orders, :mealplan, {:index=>true})
PG::Error: ERROR: column "mealplan_id" of relation "orders" does not exist
: ALTER TABLE "orders" DROP "mealplan_id"
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::Error: ERROR: column "mealplan_id" of relation "orders" does not exist
: ALTER TABLE "orders" DROP "mealplan_id"/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `exec'
...
我已经拼命的一切,包括手动删除迁移文件中的错误引用,运行rake db:reset
和重置Heroku的数据库,甚至重新启动Heroku的应用程序,但无济于事。如果有人能为这个错误提供解决方案,我将无限欣赏。我需要满足截止日期才能提交此生产代码。
在此先感谢!
你有一个迁移缺失(你添加了mealplan_id) – Anthony 2015-01-27 01:43:14
你是什么意思我有一个迁移失踪?随着我删除与另一个模型的关联,mealplan_id不再存在。 – 2015-01-27 01:45:37
错误是说在POstgres中已经删除了该引用 – Brennan 2015-01-27 01:48:10