{"action":"opened","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/5694","repository_url":"https://api.github.com/repos/sequelize/sequelize","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/5694/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/5694/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/5694/events","html_url":"https://github.com/sequelize/sequelize/issues/5694","id":145697611,"number":5694,"title":"Associations migrating problem","user":{"login":"AndrewBryukhov","id":15821889,"avatar_url":"https://avatars.githubusercontent.com/u/15821889?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewBryukhov","html_url":"https://github.com/AndrewBryukhov","followers_url":"https://api.github.com/users/AndrewBryukhov/followers","following_url":"https://api.github.com/users/AndrewBryukhov/following{/other_user}","gists_url":"https://api.github.com/users/AndrewBryukhov/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewBryukhov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewBryukhov/subscriptions","organizations_url":"https://api.github.com/users/AndrewBryukhov/orgs","repos_url":"https://api.github.com/users/AndrewBryukhov/repos","events_url":"https://api.github.com/users/AndrewBryukhov/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewBryukhov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-04T14:19:22Z","updated_at":"2016-04-04T14:19:22Z","closed_at":null,"body":"I have to create migration. I have correct models and its successfully integrates into DB. But i have problem with associations\r\n\r\n```\r\n'use strict';\r\nmodule.exports = function (sequelize, DataTypes) {\r\n    var items = sequelize.define('items', {\r\n        name: DataTypes.STRING,\r\n        volume: DataTypes.INTEGER,\r\n        weight: DataTypes.INTEGER,\r\n        code: DataTypes.INTEGER,\r\n        condition: DataTypes.INTEGER\r\n    }, {\r\n        classMethods: {\r\n            associate: function (models) {\r\n                items.hasMany(models.links);\r\n            }\r\n        },\r\n        instanceMethods: {\r\n        }\r\n    });\r\n    return items;\r\n};\r\n//links.js: ...\r\n\r\nlinks.belongsTo(models.items, {foreignKey: 'items'});\r\nor\r\n\r\nlinks.hasMany(models.items);\r\n...\r\n```\r\n\r\nProblem at line items.hasMany(models.links); I don't see changes (new columns at tables) after db:migrate:undo:all, db:migrate"}}