因此,我正在研究一個現有的應用程序,並且正在將其設置在本地環境中,但是我遇到了一些問題: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