runtimerevolution / survey

Survey is a Rails Engine that brings quizzes, surveys and contests into your Rails application.
MIT License
265 stars 127 forks source link

Migration fails #21

Open bkd opened 10 years ago

bkd commented 10 years ago

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 commented 9 years ago

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