{"action":"opened","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/5592","repository_url":"https://api.github.com/repos/sequelize/sequelize","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/5592/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/5592/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/5592/events","html_url":"https://github.com/sequelize/sequelize/issues/5592","id":141161417,"number":5592,"title":"queryInterface.addColumn with references not work in mysql","user":{"login":"ningshen","id":2252634,"avatar_url":"https://avatars.githubusercontent.com/u/2252634?v=3","gravatar_id":"","url":"https://api.github.com/users/ningshen","html_url":"https://github.com/ningshen","followers_url":"https://api.github.com/users/ningshen/followers","following_url":"https://api.github.com/users/ningshen/following{/other_user}","gists_url":"https://api.github.com/users/ningshen/gists{/gist_id}","starred_url":"https://api.github.com/users/ningshen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ningshen/subscriptions","organizations_url":"https://api.github.com/users/ningshen/orgs","repos_url":"https://api.github.com/users/ningshen/repos","events_url":"https://api.github.com/users/ningshen/events{/privacy}","received_events_url":"https://api.github.com/users/ningshen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-16T03:23:46Z","updated_at":"2016-03-16T03:23:46Z","closed_at":null,"body":"queryInterface.addColumn with references not work in mysql\r\n\r\n`queryInterface.addColumn('Contents', 'ToolId',  {type: Sequelize.INTEGER, references: {model: 'Tools', key: 'id'}})`\r\nwill result sql\r\n`ALTER TABLE `Contents` ADD `ToolId` INTEGER REFERENCES `Tools` (`id`);`\r\n\r\nthis sql statement is not right.\r\n [mysql alter column](http://dev.mysql.com/doc/refman/5.7/en/alter-table.html)\r\nadd column sql should be:\r\n`ALTER TABLE `User` ADD `ToolId` INTEGER, ADD FOREIGN KEY (`ToolId`) REFERENCES `Tools` (`id`);`\r\n"}}