{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/6734","repository_url":"https://api.github.com/repos/sequelize/sequelize","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/6734/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/6734/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/6734/events","html_url":"https://github.com/sequelize/sequelize/issues/6734","id":184627770,"number":6734,"title":"addAssociation not working","user":{"login":"ro70","id":17289564,"avatar_url":"https://avatars.githubusercontent.com/u/17289564?v=3","gravatar_id":"","url":"https://api.github.com/users/ro70","html_url":"https://github.com/ro70","followers_url":"https://api.github.com/users/ro70/followers","following_url":"https://api.github.com/users/ro70/following{/other_user}","gists_url":"https://api.github.com/users/ro70/gists{/gist_id}","starred_url":"https://api.github.com/users/ro70/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ro70/subscriptions","organizations_url":"https://api.github.com/users/ro70/orgs","repos_url":"https://api.github.com/users/ro70/repos","events_url":"https://api.github.com/users/ro70/events{/privacy}","received_events_url":"https://api.github.com/users/ro70/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-22T12:30:48Z","updated_at":"2016-10-23T10:52:51Z","closed_at":"2016-10-23T09:56:07Z","body":"## What you are doing?\r\n```js\r\nvar Sequelize = require('sequelize')\r\nvar sequelize = new Sequelize('...', '...', '...')\r\n\r\n// B and C inherit from A.\r\nvar A = sequelize.define('A',\r\n  {\r\n    // id is the primary key.\r\n    attrA: Sequelize.STRING\r\n  },\r\n  {\r\n    timestamps: true,\r\n    deletedAt: 'deletedAt',\r\n    paranoid: true\r\n  }\r\n)\r\n\r\nvar B = sequelize.define('B',\r\n  {\r\n    // id is the primary key and the foreign key (A).\r\n    attrB: Sequelize.STRING\r\n  },\r\n  {\r\n    timestamps: false,\r\n    paranoid: true\r\n  }\r\n)\r\n\r\nvar C = sequelize.define('C',\r\n  {\r\n    // id is the primary key and the foreign key (A).\r\n    attrC: Sequelize.STRING\r\n  },\r\n  {\r\n    timestamps: false,\r\n    paranoid: true\r\n  }\r\n)\r\n\r\nB.belongsTo(A, {foreignKey: 'id'})\r\nC.belongsTo(A, {foreignKey: 'id'})\r\nA.hasOne(B, {foreignKey: 'id'})\r\nA.hasOne(C, {foreignKey: 'id'})\r\n\r\n// Creating values.\r\nsequelize.sync({force: true})\r\n.then(function() {\r\n  return A.create(\r\n    {\r\n      attrA: 'AA'\r\n    }\r\n  )\r\n})\r\n.then(function(a) {\r\n  a.addB(\r\n    {\r\n      attrB: 'BB'\r\n    }\r\n  )\r\n})\r\n// Catching errors...\r\n.catch(function(err) {\r\n  console.log(err)\r\n})\r\n```\r\n\r\n## What do you expect to happen?\r\nExpecting two new entities: AA in table A and BB in table B.\r\n\r\n## What is actually happening?\r\nAA is created. Creation of BB throws\r\n```\r\nTypeError: a.addB is not a function\r\n```\r\n\r\n__Dialect:__ mysql\r\n__Database version:__ 10.1.9-MariaDB\r\n__Sequelize version:__ 3.24.4\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/255581964","html_url":"https://github.com/sequelize/sequelize/issues/6734#issuecomment-255581964","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/6734","id":255581964,"user":{"login":"ro70","id":17289564,"avatar_url":"https://avatars.githubusercontent.com/u/17289564?v=3","gravatar_id":"","url":"https://api.github.com/users/ro70","html_url":"https://github.com/ro70","followers_url":"https://api.github.com/users/ro70/followers","following_url":"https://api.github.com/users/ro70/following{/other_user}","gists_url":"https://api.github.com/users/ro70/gists{/gist_id}","starred_url":"https://api.github.com/users/ro70/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ro70/subscriptions","organizations_url":"https://api.github.com/users/ro70/orgs","repos_url":"https://api.github.com/users/ro70/repos","events_url":"https://api.github.com/users/ro70/events{/privacy}","received_events_url":"https://api.github.com/users/ro70/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T10:52:51Z","updated_at":"2016-10-23T10:52:51Z","body":"@janmeier @PerGullberg Thank you."}}
{"actor":{"display_login":"ro70"}}