relation "requests" does not exist
Closed this issue · 2 comments
ACPK commented
#6 When we run "rake db:migrate", we get the error:
PG::UndefinedTable: ERROR: relation "requests" does not exist
: CREATE TABLE "notable_requests" ("id" serial primary key, "note_type" character varying , "note" text , "user_id" integer , "user_type" character varying , "action" text , "status" integer , "url" text , "request_id" character varying , "ip" character varying , "user_agent" text , "referrer" text , "params" text , "request_time" decimal , "created_at" timestamp , CONSTRAINT fk_notable_requests_user_id FOREIGN KEY ("user_id") REFERENCES "users" ("id"), CONSTRAINT fk_notable_requests_request_id FOREIGN KEY ("request_id") REFERENCES "requests" ("id"))
/Users/andrewkelley/Documents/websites/frontend/db/migrate/20170724194710_create_notable_requests.rb:3:in `change'
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "requests" does not exist
: CREATE TABLE "notable_requests" ("id" serial primary key, "note_type" character varying , "note" text , "user_id" integer , "user_type" character varying , "action" text , "status" integer , "url" text , "request_id" character varying , "ip" character varying , "user_agent" text , "referrer" text , "params" text , "request_time" decimal , "created_at" timestamp , CONSTRAINT fk_notable_requests_user_id FOREIGN KEY ("user_id") REFERENCES "users" ("id"), CONSTRAINT fk_notable_requests_request_id FOREIGN KEY ("request_id") REFERENCES "requests" ("id"))
/Users/andrewkelley/Documents/websites/frontend/db/migrate/20170724194710_create_notable_requests.rb:3:in `change'
PG::UndefinedTable: ERROR: relation "requests" does not exist
/Users/andrewkelley/Documents/websites/frontend/db/migrate/20170724194710_create_notable_requests.rb:3:in `change'
The issue is being caused by the migration with the line "t.string :request_id"
ankane commented
@ACPK It looks like something is creating a foreign key constraints (possibly another gem).
ankane commented
Cleaning up stale issues