{"action":"created","issue":{"url":"https://api.github.com/repos/jspizziri/sequelize-connect/issues/16","repository_url":"https://api.github.com/repos/jspizziri/sequelize-connect","labels_url":"https://api.github.com/repos/jspizziri/sequelize-connect/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/jspizziri/sequelize-connect/issues/16/comments","events_url":"https://api.github.com/repos/jspizziri/sequelize-connect/issues/16/events","html_url":"https://github.com/jspizziri/sequelize-connect/issues/16","id":303524959,"number":16,"title":"Associations doesn't work","user":{"login":"juanda645","id":11078184,"avatar_url":"https://avatars2.githubusercontent.com/u/11078184?v=4","gravatar_id":"","url":"https://api.github.com/users/juanda645","html_url":"https://github.com/juanda645","followers_url":"https://api.github.com/users/juanda645/followers","following_url":"https://api.github.com/users/juanda645/following{/other_user}","gists_url":"https://api.github.com/users/juanda645/gists{/gist_id}","starred_url":"https://api.github.com/users/juanda645/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanda645/subscriptions","organizations_url":"https://api.github.com/users/juanda645/orgs","repos_url":"https://api.github.com/users/juanda645/repos","events_url":"https://api.github.com/users/juanda645/events{/privacy}","received_events_url":"https://api.github.com/users/juanda645/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-08T15:40:00Z","updated_at":"2018-04-02T13:48:03Z","closed_at":null,"author_association":"NONE","body":"I create a model like this:\r\n```js\r\n// user.model.js\r\n\"use strict\";\r\n\r\nmodule.exports = function(sequelize, DataTypes) {\r\n  var User = sequelize.define(\"User\", {\r\n    username: DataTypes.STRING\r\n  }, {\r\n    classMethods: {\r\n      associate: function(models) {\r\n        User.hasMany(models.Task)\r\n      }\r\n    }\r\n  });\r\n\r\n  return User;\r\n};\r\n```\r\nBut the association doesn't appear in the data base, what i doing wrong?"},"comment":{"url":"https://api.github.com/repos/jspizziri/sequelize-connect/issues/comments/377932669","html_url":"https://github.com/jspizziri/sequelize-connect/issues/16#issuecomment-377932669","issue_url":"https://api.github.com/repos/jspizziri/sequelize-connect/issues/16","id":377932669,"user":{"login":"jspizziri","id":1452066,"avatar_url":"https://avatars2.githubusercontent.com/u/1452066?v=4","gravatar_id":"","url":"https://api.github.com/users/jspizziri","html_url":"https://github.com/jspizziri","followers_url":"https://api.github.com/users/jspizziri/followers","following_url":"https://api.github.com/users/jspizziri/following{/other_user}","gists_url":"https://api.github.com/users/jspizziri/gists{/gist_id}","starred_url":"https://api.github.com/users/jspizziri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jspizziri/subscriptions","organizations_url":"https://api.github.com/users/jspizziri/orgs","repos_url":"https://api.github.com/users/jspizziri/repos","events_url":"https://api.github.com/users/jspizziri/events{/privacy}","received_events_url":"https://api.github.com/users/jspizziri/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T13:48:03Z","updated_at":"2018-04-02T13:48:03Z","author_association":"OWNER","body":"@juanda645,\r\n\r\nAre you sure that `user.model.js` is in a discoverable path when you configured `sequelize-connect`?\r\n\r\ne.g. If I do the following:\r\n\r\n```\r\n// app.js\r\nvar Connection \t\t= require('sequelize-connect');\r\n\r\nvar discover = [__dirname + '/models', ...];\r\nvar orm = new Connection(\r\n  'test-db',\r\n  'test-user',\r\n  'secret1234',\r\n  {\r\n    dialect: \"mysql\",\r\n    port:    3306\r\n  },\r\n  discover,\r\n)\r\n.then(function(instance){\r\n  // Connection is completed\r\n});\r\n```\r\n\r\nthen `user.model.js` needs to be within `var discover = [__dirname + '/models', ...];`."}}
{"actor":{"display_login":"jspizziri"}}