因此,我正在研究一个现有的应用程序,并且正在将其设置在本地环境中,但是我遇到了一些问题:PG :: UndefinedTable:错误:关系“事件”不存在
1.我已经拉下最新的代码,并从内部开发人员倾销DB。这是一个.sql文件,所以我用下面的命令:
$psql -h localhost -U root -d thms_development < /Users/me/mypath/public.sql
2.这似乎有工作,但在整个转储过程我看到 奇错误,如:
ERROR: role "rails_staging" does not exist
NOTICE: table "bidding_plans" does not exist, skipping
DROP TABLE
ERROR: type "public.eh_allocation_plan_status" does not exist
LINE 6: "status" "public"."eh_allocation_plan_status" DEFAULT 'clos...
^
ERROR: relation "public.bidding_plans" does not exist
BEGIN
ERROR: relation "public.bidding_plans" does not exist
LINE 1: INSERT INTO "public"."bidding_plans" VALUES ('8204668e-ca65-...
和其他类似的。
最后,当我启动应用程序了,点击活动链接,我 得到如下:
Started GET "/api/v2/client_events/events_for_venue?venue_id=7d72f8d9-f39f-4ed6-a24e-fb1cf23bd62e" for 127.0.0.1 at 2015-03-18 19:49:40 -0400
Processing by Api::V2::ClientEventsController#events_for_venue as JSON
Parameters: {"venue_id"=>"7d72f8d9-f39f-4ed6-a24e-fb1cf23bd62e"}
PG::UndefinedTable: ERROR: relation "events" does not exist
LINE 5: WHERE a.attrelid = '"events"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"events"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Completed 500 Internal Server Error in 8ms
PG::UndefinedTable - ERROR: relation "events" does not exist
LINE 5: WHERE a.attrelid = '"events"'::regclass
^
:
我已经跑了分贝:设置,这是确切的相同的代码和数据库,目前的开发人员正在使用,出了什么问题?
谢谢!
随着转储文件,你想知道产生它的命令。第一个错误是预料之中的,因为角色是在dbs之间共享的,并且他们不会被转储到单个数据库转储中。但第二个看起来有问题,使该文件无法作为独立转储使用。 – 2015-03-19 12:45:07