{"action":"created","issue":{"url":"https://api.github.com/repos/propelorm/Propel2/issues/978","labels_url":"https://api.github.com/repos/propelorm/Propel2/issues/978/labels{/name}","comments_url":"https://api.github.com/repos/propelorm/Propel2/issues/978/comments","events_url":"https://api.github.com/repos/propelorm/Propel2/issues/978/events","html_url":"https://github.com/propelorm/Propel2/issues/978","id":99865666,"number":978,"title":"Saving object with modified primary key","user":{"login":"bre7","id":3183848,"avatar_url":"https://avatars.githubusercontent.com/u/3183848?v=3","gravatar_id":"","url":"https://api.github.com/users/bre7","html_url":"https://github.com/bre7","followers_url":"https://api.github.com/users/bre7/followers","following_url":"https://api.github.com/users/bre7/following{/other_user}","gists_url":"https://api.github.com/users/bre7/gists{/gist_id}","starred_url":"https://api.github.com/users/bre7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bre7/subscriptions","organizations_url":"https://api.github.com/users/bre7/orgs","repos_url":"https://api.github.com/users/bre7/repos","events_url":"https://api.github.com/users/bre7/events{/privacy}","received_events_url":"https://api.github.com/users/bre7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-09T05:12:06Z","updated_at":"2015-08-11T14:48:12Z","closed_at":null,"body":"I've tried searching for a similar issue but couldn't find any (here at least, I did find something similar but with no clear solution on the forums).\r\nHow can I save an object if the PK has been modified ? The log shows that new PK is used in the WHERE clause (e.g: Original PK was 25)\r\n>[2015-08-09 07:20:43] defaultLogger.INFO: UPDATE `author` SET `ID`=55 WHERE author.ID=55 [] []\r\n\r\nSandbox: http://sandbox.propelorm.org/486a545\r\n\r\nThe only solutions I could think of were:\r\n* Deleting the old object and saving a new one with the new PK\r\n* Use a SQL query instead of set... and save()\r\n\r\nThanks :wink: "},"comment":{"url":"https://api.github.com/repos/propelorm/Propel2/issues/comments/129914377","html_url":"https://github.com/propelorm/Propel2/issues/978#issuecomment-129914377","issue_url":"https://api.github.com/repos/propelorm/Propel2/issues/978","id":129914377,"user":{"login":"bre7","id":3183848,"avatar_url":"https://avatars.githubusercontent.com/u/3183848?v=3","gravatar_id":"","url":"https://api.github.com/users/bre7","html_url":"https://github.com/bre7","followers_url":"https://api.github.com/users/bre7/followers","following_url":"https://api.github.com/users/bre7/following{/other_user}","gists_url":"https://api.github.com/users/bre7/gists{/gist_id}","starred_url":"https://api.github.com/users/bre7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bre7/subscriptions","organizations_url":"https://api.github.com/users/bre7/orgs","repos_url":"https://api.github.com/users/bre7/repos","events_url":"https://api.github.com/users/bre7/events{/privacy}","received_events_url":"https://api.github.com/users/bre7/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T14:48:12Z","updated_at":"2015-08-11T14:48:12Z","body":"I think a possible (and the easiest) solution would be to store the Pk when the object is created in another variable called originalPK or something. "}}