{"action":"created","issue":{"url":"https://api.github.com/repos/duckduckgo/community-platform/issues/476","labels_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/476/labels{/name}","comments_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/476/comments","events_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/476/events","html_url":"https://github.com/duckduckgo/community-platform/issues/476","id":55649589,"number":476,"title":"Schema migration policy.","user":{"login":"jbarrett","id":444449,"avatar_url":"https://avatars.githubusercontent.com/u/444449?v=3","gravatar_id":"","url":"https://api.github.com/users/jbarrett","html_url":"https://github.com/jbarrett","followers_url":"https://api.github.com/users/jbarrett/followers","following_url":"https://api.github.com/users/jbarrett/following{/other_user}","gists_url":"https://api.github.com/users/jbarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/jbarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbarrett/subscriptions","organizations_url":"https://api.github.com/users/jbarrett/orgs","repos_url":"https://api.github.com/users/jbarrett/repos","events_url":"https://api.github.com/users/jbarrett/events{/privacy}","received_events_url":"https://api.github.com/users/jbarrett/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/duckduckgo/community-platform/labels/Improvement","name":"Improvement","color":"fbca04"},{"url":"https://api.github.com/repos/duckduckgo/community-platform/labels/Priority:%20High","name":"Priority: High","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-27T17:40:50Z","updated_at":"2015-02-05T20:39:59Z","closed_at":null,"body":"[`script/ddgc_db_autoupgrade.pl`](https://github.com/duckduckgo/community-platform/blob/dev/script/ddgc_db_autoupgrade.pl) should be considered informational for developers working on schema changes, not the canonical source of diffs post-merge/deployment.\r\n\r\nI'd like to discuss options for making schema changes available to developers and for deployment. High-level proposal, we have a `sql/` or `migration/` directory which contains a script containing DDL and data migration for each task or version. These scripts can then be run on every required instance, plus we have a reasonably easy-to-reference history of changes.\r\n\r\nSo, say the last version was 1.006, in preparing for version 1.007 we would have:\r\n\r\n```\r\nsql/1.007/task-branchname.sql\r\nsql/1.007/other-task-branchname.sql\r\n```\r\n\r\n...containing the required DDL and data updates for that version - you bear the responsibility for defining the DDL when schema changes are made. I'm not sure if the idea needs much expansion beyond this :)\r\n\r\n@jdorweiler @MariagraziaAlastra @russellholt Thanks!"},"comment":{"url":"https://api.github.com/repos/duckduckgo/community-platform/issues/comments/73122452","html_url":"https://github.com/duckduckgo/community-platform/issues/476#issuecomment-73122452","issue_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/476","id":73122452,"user":{"login":"jdorweiler","id":1882892,"avatar_url":"https://avatars.githubusercontent.com/u/1882892?v=3","gravatar_id":"","url":"https://api.github.com/users/jdorweiler","html_url":"https://github.com/jdorweiler","followers_url":"https://api.github.com/users/jdorweiler/followers","following_url":"https://api.github.com/users/jdorweiler/following{/other_user}","gists_url":"https://api.github.com/users/jdorweiler/gists{/gist_id}","starred_url":"https://api.github.com/users/jdorweiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdorweiler/subscriptions","organizations_url":"https://api.github.com/users/jdorweiler/orgs","repos_url":"https://api.github.com/users/jdorweiler/repos","events_url":"https://api.github.com/users/jdorweiler/events{/privacy}","received_events_url":"https://api.github.com/users/jdorweiler/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T20:39:59Z","updated_at":"2015-02-05T20:39:59Z","body":"I'm the lucky first victim :cactus:   \r\nIt sounds like I should run `ddgc_schema_diff` and commit the output from that script into `sql/version/`?  Then someone would still have to manually update their DB using that file. "}}