{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/3652","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/3652/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3652/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/3652/events","html_url":"https://github.com/sequelize/sequelize/issues/3652","id":73361215,"number":3652,"title":"Exception in 'upsert'.","user":{"login":"ziflex","id":1607148,"avatar_url":"https://avatars.githubusercontent.com/u/1607148?v=3","gravatar_id":"","url":"https://api.github.com/users/ziflex","html_url":"https://github.com/ziflex","followers_url":"https://api.github.com/users/ziflex/followers","following_url":"https://api.github.com/users/ziflex/following{/other_user}","gists_url":"https://api.github.com/users/ziflex/gists{/gist_id}","starred_url":"https://api.github.com/users/ziflex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziflex/subscriptions","organizations_url":"https://api.github.com/users/ziflex/orgs","repos_url":"https://api.github.com/users/ziflex/repos","events_url":"https://api.github.com/users/ziflex/events{/privacy}","received_events_url":"https://api.github.com/users/ziflex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-05T16:25:54Z","updated_at":"2015-05-05T16:27:37Z","closed_at":null,"body":"Hi there.\r\n\r\nI've got such model:\r\n```js\r\nvar Preferences = sequelize.define('Preferences', {\r\n    key: { type: Sequelize.STRING, allowNull: false, unique: true },\r\n    value: { type: Sequelize.STRING }\r\n}, { timestamps: false });\r\n\r\nPreferences.removeAttribute('id');\r\n```\r\n\r\nand when I try to call 'upsert' method I get this exception:\r\n``` \r\nCannot read property 'defaultValue' of undefined\r\n```\r\n\r\nError occurs [here](https://github.com/sequelize/sequelize/blob/master/lib/model.js#L1252).\r\n\r\nIs it a bug or I do something wrong ?"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/99132364","html_url":"https://github.com/sequelize/sequelize/issues/3652#issuecomment-99132364","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/3652","id":99132364,"user":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T16:27:37Z","updated_at":"2015-05-05T16:27:37Z","body":"`upsert` assumes you have a primary key on your model it seems."}}