Sails.js - Is there intended support for a “one-way-many” association

后端 未结 1 900
梦谈多话
梦谈多话 2021-01-22 02:36

I\'m interested in a one-way-many association. To explain:

// Dog.js
module.exports = {

    attributes: {
        name: {
            type: \'strin         


        
相关标签:
1条回答
  • 2021-01-22 03:09

    I think you should be ok.

    However, there does not really seem any reason to not complete the association for a Many to Many. The reason would be because everything is already being created for that single collection. The join table and its attributes are already there. The only thing missing in this equation is the reference back on food.

    I could understand if putting the association on food were to create another table or create another weird join, but that has already been done. There really is no overhead to creating the other association.

    So in theory you might as well create it, thus avoiding any potential conflicts unless you have a really compelling reason not to?

    Edited: Based on the comments below we should note that one could experience overhead in lift based the blueprints and dynamic finders created.

    0 讨论(0)
提交回复
热议问题