Giter Site home page Giter Site logo

Comments (7)

solnic avatar solnic commented on June 28, 2024

Which foreign key?

by Piotr Solnica (solnic)

from dm-core.

solnic avatar solnic commented on June 28, 2024

loaner_id and loanee_id.

by Siegfried Levin

from dm-core.

solnic avatar solnic commented on June 28, 2024

@siegfried: Did you use DataMapper.finalize after declaring the models, but before running DataMapper.auto_upgrade! ? It is responsible for inferring the foreign keys and setting them up so that the migration will add them.

by Dan Kubb (dkubb)

from dm-core.

solnic avatar solnic commented on June 28, 2024

@dkubb: I do use DataMapper.finalize.

by Siegfried Levin

from dm-core.

nicosalvo avatar nicosalvo commented on June 28, 2024

I'm experiencing the same problem using datamapper 1.2.0, any help well be appreciated.

from dm-core.

ksimard avatar ksimard commented on June 28, 2024

i am using 1.0.2 and i am also having foreign key issues. except my issue is that i added a :required => false flag and it is not dropping the foreign key constraint

i use finalize and auto_upgrade!

from dm-core.

dkubb avatar dkubb commented on June 28, 2024

@ksimard auto-upgrading is only additive, this means it only adds new tables, columns, indexes (and foreign keys someday). It will never remove or rename things. In DM2 we may have it make changes that we can determine are "safe", but otherwise in DM1 auto-upgrading will never change something that already exists.

from dm-core.

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.