[英]Can't access db after adding to Heroku
I can't access my Postgres tables since putting my app on Heroku. 自将我的应用程序放在Heroku上以来,我无法访问Postgres表。 I checked the logs with heroku logs --tail
and saw this error 我用heroku logs --tail
检查了日志,并看到此错误
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "companies" does not exist
I've run as many different rake
combinations of drop
create
migrate
seed
, and reset
as I can think of with no luck. 我已经运行许多不同的rake
的组合drop
create
migrate
seed
,并reset
为我能想到的,没有运气。
I created a new endpoint on that app ( /api/v1/testing/
) and I was able to access that endpoint with no problem. 我在该应用程序( /api/v1/testing/
)上创建了一个新端点,并且能够毫无问题地访问该端点。
I am still able to access all of the tables on the db locally when I run rails s
. 运行rails s
时,我仍然可以在本地访问数据库上的所有表。
I don't know which files from my app would be helpful to solve this problem but I am happy to add any detail that would be helpful. 我不知道应用程序中的哪些文件有助于解决此问题,但我很乐意添加任何有用的细节。
I'm guessing you didn't run: 我猜你没跑:
heroku run rake db:migrate --app your_app_name
(replacing your_app_name
, naturally.) (自然地替换your_app_name
。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.