-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB Migration Error #26
Comments
Hi @pvagare, Did you change the migration file to force a foreign key reference between survey_questions and surveys? I'm trying to mimic your issues with the migration, but I'm not seeing that constraint in the Postgres generated SQL. Could you show me the 20150515142125_create_survey.rb and your schema.rb files? Thank you! |
Hi! A few years later but I am having the same error. Just following the instruction in the read me (no changes in the migration) and I have this same result: PG::UndefinedTable: ERROR: relation "surveys" does not exist |
@alex-quiterio sorry for unassigning you. No idea of how i did it... |
Hi ,
Please suggest the solution for Db migration error.
-> 0.0838s
-- create_table(:survey_questions)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedTable: ERROR: relation "surveys" does not exist
: CREATE TABLE "survey_questions" ("id" serial primary key, "survey_id" integer, "text" character varying(255), "created_at" timestamp, "updated_at" timestamp, CONSTRAINT fk_survey_questions_survey_id FOREIGN KEY ("survey_id") REFERENCES "surveys" ("id")) /home/test/db/migrate/20150515142125_create_survey.rb:15:in
up' ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "surveys" does not exist : CREATE TABLE "survey_questions" ("id" serial primary key, "survey_id" integer, "text" character varying(255), "created_at" timestamp, "updated_at" timestamp, CONSTRAINT fk_survey_questions_survey_id FOREIGN KEY ("survey_id") REFERENCES "surveys" ("id")) /home/test/db/migrate/20150515142125_create_survey.rb:15:in
up'PG::UndefinedTable: ERROR: relation "surveys" does not exist
/home/test/db/migrate/20150515142125_create_survey.rb:15:in `up'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Thank you !
The text was updated successfully, but these errors were encountered: