【发布时间】:2014-05-07 06:58:23
【问题描述】:
我有一个架构,我们称之为“被遗忘的”架构,rails 似乎可以识别并使用它大约几个小时,但由于我不知道的原因,我开始收到如下错误:
ActiveRecord::StatementInvalid (PG::Error: ERROR: schema "forgotten" does not exist
LINE 1: SELECT COUNT(*) FROM "forgotten"."stuff"
ActionView::Template::Error (PG::Error: ERROR: schema "forgotten" does not exist
LINE 1: ...COUNT(DISTINCT "forgotten"."other_stuff"."id") FROM "forgotten"."oth...
几乎就像 rails 忘记了我的架构存在。
我的数据库.yml:
production:
adapter: postgresql
encoding: UTF8
username: xxxxxx
host: xxxxx
database: xxxxx
password: xxxxx
我希望它像添加一样简单:
schema_search_path: 'forgotten, public'
但我得到了相同的结果。
一旦这种情况开始发生,我的应用程序的其他部分就可以毫无问题地使用公共表,而不是任何使用非公共模式的部分。让它再次工作的唯一方法是重新启动 nginx/passenger。然后事情又正常工作了几个小时,直到架构问题再次出现。
因此,我希望向那些希望之前遇到并解决过此问题的开发人员提出建议。谢谢!
【问题讨论】:
标签: ruby-on-rails postgresql activerecord pg