Skip to content
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

Migration fails #21

Open
bkd opened this issue Sep 3, 2014 · 1 comment
Open

Migration fails #21

bkd opened this issue Sep 3, 2014 · 1 comment
Assignees

Comments

@bkd
Copy link

bkd commented Sep 3, 2014

Hi

Migrating to CreateSurvey (20140903155504)
(0.1ms) BEGIN
== 20140903155504 CreateSurvey: migrating =====================================
-- create_table(:survey_surveys)
(19.5ms) CREATE TABLE "survey_surveys" ("id" serial primary key, "name" character varying(255), "description" text, "attempts_number" integer DEFAULT 0, "finished" boolean DEFAULT 'f', "active" boolean DEFAULT 'f', "created_at" timestamp, "updated_at" timestamp)
-> 0.0232s
-- create_table(:survey_questions)
(1.5ms) SELECT f.conname, pg_get_constraintdef(f.oid), t.relname
FROM pg_class t, pg_constraint f
WHERE f.conrelid = t.oid
AND f.contype = 'f'
AND t.relname = 'survey_questions'
AND t.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) )

(13.8ms) 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"))
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"))
(0.2ms) ROLLBACK
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/empire/rails4-starterkit/db/migrate/20140903155504_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/empire/rails4-starterkit/db/migrate/20140903155504_create_survey.rb:15:inup'
PG::UndefinedTable: ERROR: relation "surveys" does not exist
/home/empire/rails4-starterkit/db/migrate/20140903155504_create_survey.rb:15:in `up'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Seems odd, any suggestions?

@alex-quiterio
Copy link
Contributor

Hi @bkd,

Thank you for the description here. We'll try to replicate the issue in our side and provide some feedback thereafter.

Best,
A.Q

@alex-quiterio alex-quiterio self-assigned this Apr 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants