{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/3032","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/3032/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3032/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/3032/events","html_url":"https://github.com/sequelize/sequelize/issues/3032","id":56026245,"number":3032,"title":"Sequelize 1.7.9 calling save() problem","user":{"login":"nomadster","id":1690795,"avatar_url":"https://avatars.githubusercontent.com/u/1690795?v=3","gravatar_id":"","url":"https://api.github.com/users/nomadster","html_url":"https://github.com/nomadster","followers_url":"https://api.github.com/users/nomadster/followers","following_url":"https://api.github.com/users/nomadster/following{/other_user}","gists_url":"https://api.github.com/users/nomadster/gists{/gist_id}","starred_url":"https://api.github.com/users/nomadster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomadster/subscriptions","organizations_url":"https://api.github.com/users/nomadster/orgs","repos_url":"https://api.github.com/users/nomadster/repos","events_url":"https://api.github.com/users/nomadster/events{/privacy}","received_events_url":"https://api.github.com/users/nomadster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-30T12:07:43Z","updated_at":"2015-02-03T13:48:56Z","closed_at":null,"body":"\r\nHi guys, I know 1.7.* isn't the bleeding edge version, but i have this in production (we are planning to upgrade to 2.0.0 when it's ready) and have a bug to fix  :)\r\n\r\nThe following code\r\n\r\n```JavaScript\r\nfunction modifyUser(usr){\r\n   usr.one_field = 42;\r\n   return usr.save(); \r\n}\r\n\r\nUser.build(....)\r\n  .then(function(user){\r\n    return modifyUser(user);\r\n  }).then(function(){\r\n     console.log('Exit from ehere');\r\n  });\r\n```\r\n\r\nproduces ad UPDATE query, which fails:\r\n```\r\nUPDATE `users_tbl` SET `user_type`='person', ... ,`user_FK_company_id`=1 WHERE `user_id` IS NULL\r\n```\r\nsince there is no entry with user_id=NULL on the db.\r\n\r\nShould build() create an object that, once we call save() on it, will produce an INSERT??\r\n\r\nAm I missing something?\r\nWe are using MySQL.\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/72652744","html_url":"https://github.com/sequelize/sequelize/issues/3032#issuecomment-72652744","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/3032","id":72652744,"user":{"login":"janmeier","id":1210224,"avatar_url":"https://avatars.githubusercontent.com/u/1210224?v=3","gravatar_id":"","url":"https://api.github.com/users/janmeier","html_url":"https://github.com/janmeier","followers_url":"https://api.github.com/users/janmeier/followers","following_url":"https://api.github.com/users/janmeier/following{/other_user}","gists_url":"https://api.github.com/users/janmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/janmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janmeier/subscriptions","organizations_url":"https://api.github.com/users/janmeier/orgs","repos_url":"https://api.github.com/users/janmeier/repos","events_url":"https://api.github.com/users/janmeier/events{/privacy}","received_events_url":"https://api.github.com/users/janmeier/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T13:48:56Z","updated_at":"2015-02-03T13:48:56Z","body":"Build followed by save inserts fine for me. You'll need to provide at more isolated test case for us to debug further"}}