Giter Site home page Giter Site logo

DB Migration Error about survey HOT 3 OPEN

pvagare avatar pvagare commented on August 21, 2024
DB Migration Error

from survey.

Comments (3)

alex-quiterio avatar alex-quiterio commented on August 21, 2024

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!

from survey.

develaper avatar develaper commented on August 21, 2024

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:
`$ bundle exec rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20170522133701 CreateSurvey: migrating =====================================
-- create_table(:survey_surveys)
-> 0.1217s
-- 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 , "created_at" timestamp , "updated_at" timestamp , CONSTRAINT fk_survey_questions_survey_id FOREIGN KEY ("survey_id") REFERENCES "surveys" ("id"))
`

from survey.

develaper avatar develaper commented on August 21, 2024

@alex-quiterio sorry for unassigning you. No idea of how i did it...

from survey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.