{"action":"created","issue":{"url":"https://api.github.com/repos/socrata/soql-postgres-adapter/issues/52","labels_url":"https://api.github.com/repos/socrata/soql-postgres-adapter/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/socrata/soql-postgres-adapter/issues/52/comments","events_url":"https://api.github.com/repos/socrata/soql-postgres-adapter/issues/52/events","html_url":"https://github.com/socrata/soql-postgres-adapter/pull/52","id":66383957,"number":52,"title":"CORE-4794 Rollups are not created on resync.","user":{"login":"chitang","id":314720,"avatar_url":"https://avatars.githubusercontent.com/u/314720?v=3","gravatar_id":"","url":"https://api.github.com/users/chitang","html_url":"https://github.com/chitang","followers_url":"https://api.github.com/users/chitang/followers","following_url":"https://api.github.com/users/chitang/following{/other_user}","gists_url":"https://api.github.com/users/chitang/gists{/gist_id}","starred_url":"https://api.github.com/users/chitang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chitang/subscriptions","organizations_url":"https://api.github.com/users/chitang/orgs","repos_url":"https://api.github.com/users/chitang/repos","events_url":"https://api.github.com/users/chitang/events{/privacy}","received_events_url":"https://api.github.com/users/chitang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"znep","id":556719,"avatar_url":"https://avatars.githubusercontent.com/u/556719?v=3","gravatar_id":"","url":"https://api.github.com/users/znep","html_url":"https://github.com/znep","followers_url":"https://api.github.com/users/znep/followers","following_url":"https://api.github.com/users/znep/following{/other_user}","gists_url":"https://api.github.com/users/znep/gists{/gist_id}","starred_url":"https://api.github.com/users/znep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znep/subscriptions","organizations_url":"https://api.github.com/users/znep/orgs","repos_url":"https://api.github.com/users/znep/repos","events_url":"https://api.github.com/users/znep/events{/privacy}","received_events_url":"https://api.github.com/users/znep/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-04-05T00:31:37Z","updated_at":"2015-04-05T22:01:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/socrata/soql-postgres-adapter/pulls/52","html_url":"https://github.com/socrata/soql-postgres-adapter/pull/52","diff_url":"https://github.com/socrata/soql-postgres-adapter/pull/52.diff","patch_url":"https://github.com/socrata/soql-postgres-adapter/pull/52.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/socrata/soql-postgres-adapter/issues/comments/89862078","html_url":"https://github.com/socrata/soql-postgres-adapter/pull/52#issuecomment-89862078","issue_url":"https://api.github.com/repos/socrata/soql-postgres-adapter/issues/52","id":89862078,"user":{"login":"znep","id":556719,"avatar_url":"https://avatars.githubusercontent.com/u/556719?v=3","gravatar_id":"","url":"https://api.github.com/users/znep","html_url":"https://github.com/znep","followers_url":"https://api.github.com/users/znep/followers","following_url":"https://api.github.com/users/znep/following{/other_user}","gists_url":"https://api.github.com/users/znep/gists{/gist_id}","starred_url":"https://api.github.com/users/znep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znep/subscriptions","organizations_url":"https://api.github.com/users/znep/orgs","repos_url":"https://api.github.com/users/znep/repos","events_url":"https://api.github.com/users/znep/events{/privacy}","received_events_url":"https://api.github.com/users/znep/received_events","type":"User","site_admin":false},"created_at":"2015-04-05T22:01:36Z","updated_at":"2015-04-05T22:01:36Z","body":"Awesome, thanks @chitang.  Good to merge modulo the one nit on line 423.\r\n\r\nI don't like this codepath and think the real fix is a bigger refactor of that whole method to have fewer codepaths where things can go wrong in different ways.  In particular, the match block at https://github.com/socrata/soql-postgres-adapter/blob/rollup_on_resync/store-pg/src/main/scala/com/socrata/pg/store/PGSecondary.scala#L359-L394 really should be refactored so we only create copies, etc. in one place.  Instead of a different code path if it exists or not, make it always try to remove an existing copy, then have one path for creation regardless.\r\n\r\nBut that is probably too big and risky of a thing to try to do right now."}}