{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/3585","repository_url":"https://api.github.com/repos/realm/realm-cocoa","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3585/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3585/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3585/events","html_url":"https://github.com/realm/realm-cocoa/issues/3585","id":154877909,"number":3585,"title":"Realm.io Primary key property 'serverId' has duplicate values after migration.'","user":{"login":"danpe","id":2140323,"avatar_url":"https://avatars.githubusercontent.com/u/2140323?v=3","gravatar_id":"","url":"https://api.github.com/users/danpe","html_url":"https://github.com/danpe","followers_url":"https://api.github.com/users/danpe/followers","following_url":"https://api.github.com/users/danpe/following{/other_user}","gists_url":"https://api.github.com/users/danpe/gists{/gist_id}","starred_url":"https://api.github.com/users/danpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danpe/subscriptions","organizations_url":"https://api.github.com/users/danpe/orgs","repos_url":"https://api.github.com/users/danpe/repos","events_url":"https://api.github.com/users/danpe/events{/privacy}","received_events_url":"https://api.github.com/users/danpe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/S:Waiting%20For%20User","name":"S:Waiting For User","color":"ededed"},{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/T:Help","name":"T:Help","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"austinzheng","id":3687054,"avatar_url":"https://avatars.githubusercontent.com/u/3687054?v=3","gravatar_id":"","url":"https://api.github.com/users/austinzheng","html_url":"https://github.com/austinzheng","followers_url":"https://api.github.com/users/austinzheng/followers","following_url":"https://api.github.com/users/austinzheng/following{/other_user}","gists_url":"https://api.github.com/users/austinzheng/gists{/gist_id}","starred_url":"https://api.github.com/users/austinzheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austinzheng/subscriptions","organizations_url":"https://api.github.com/users/austinzheng/orgs","repos_url":"https://api.github.com/users/austinzheng/repos","events_url":"https://api.github.com/users/austinzheng/events{/privacy}","received_events_url":"https://api.github.com/users/austinzheng/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-05-14T22:03:01Z","updated_at":"2016-06-14T12:17:39Z","closed_at":"2016-06-14T12:17:39Z","body":"After upgrading to Realm `0.102` from `0.95.3` I added a migration to support the `optional`\r\n\r\n        realmConfig.migrationBlock = ^(RLMMigration *migration, uint64_t oldSchemaVersion) {\r\n            [migration enumerateObjects: GKUser.className block:^(RLMObject *oldObject, RLMObject *newObject) {\r\n                if (oldSchemaVersion < 6) {\r\n                    NSLog(@\"serverId: %@\", oldObject[@\"serverId\"]);\r\n                    newObject[@\"userId\"] = [oldObject[@\"userId\"] length] > 0 ? oldObject[@\"userId\"] : nil;\r\n                    newObject[@\"profilePic\"] = [oldObject[@\"profilePic\"] length] > 0 ? oldObject[@\"profilePic\"] : nil;\r\n                }\r\n            }];\r\n        };\r\n\r\nI'm getting the following error:\r\n\r\n    2016-05-12 17:27:16.342 MyApp[37326:2727222] *** Terminating app due to uncaught exception 'RLMException', reason: 'Primary key property 'serverId' has duplicate values after migration.'\r\n\r\nAs you see I'm also printing the `serverId` and in all those prints nothing is duplicate.\r\n\r\nLink to SO: http://stackoverflow.com/questions/37197818/realm-io-primary-key-property-serverid-has-duplicate-values-after-migration"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/225863382","html_url":"https://github.com/realm/realm-cocoa/issues/3585#issuecomment-225863382","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3585","id":225863382,"user":{"login":"stel","id":429275,"avatar_url":"https://avatars.githubusercontent.com/u/429275?v=3","gravatar_id":"","url":"https://api.github.com/users/stel","html_url":"https://github.com/stel","followers_url":"https://api.github.com/users/stel/followers","following_url":"https://api.github.com/users/stel/following{/other_user}","gists_url":"https://api.github.com/users/stel/gists{/gist_id}","starred_url":"https://api.github.com/users/stel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stel/subscriptions","organizations_url":"https://api.github.com/users/stel/orgs","repos_url":"https://api.github.com/users/stel/repos","events_url":"https://api.github.com/users/stel/events{/privacy}","received_events_url":"https://api.github.com/users/stel/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T12:17:39Z","updated_at":"2016-06-14T12:17:39Z","body":"Closed due to inactivity."}}
{"actor":{"display_login":"stel"}}