{"action":"opened","issue":{"number":104,"created_at":"2011-10-25T10:21:06Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi,\r\n\r\nI am encountering a problem with many to many relationships. If we have for example the following:\r\n\r\nvar Media = sequelize.import(__dirname +'/models/media');\r\nvar Project = sequelize.import(__dirname +'/models/subChapter');\r\nProject.hasMany(Media);\r\nMedia.hasMany(Project);\r\n\r\nThen a table called MediaProjects will be created. \r\n\r\nWhen I want to add a Media object to my project, it will read out every Media object, delete them all and then add them back to the database, including the new one. I think that a single insert would begood enough...?\r\n\r\nCould you please look into this? This performance penalty is just too great when this happens.\r\n\r\nI noticed that this table will have primary keys defined for MediaId and for ProjectId. Why is this?\r\n\r\nkeep up the good work.\r\n\r\nCheers,\r\nLaurent\r\n","comments":0,"title":"Many to many relationships problem","updated_at":"2011-10-25T10:21:06Z","url":"https://api.github.com/repos/sdepold/sequelize/issues/104","id":2043500,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"0d6f6a7322479a9a348eb55d611b5809","avatar_url":"https://secure.gravatar.com/avatar/0d6f6a7322479a9a348eb55d611b5809?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/LaurentZuijdwijk","id":960088,"login":"LaurentZuijdwijk"},"html_url":"https://github.com/sdepold/sequelize/issues/104","labels":[],"state":"open"},"legacy":{"number":104,"action":"opened","issue":2043500}}