{"action":"created","issue":{"url":"https://api.github.com/repos/CCI-MOC/haas/issues/561","repository_url":"https://api.github.com/repos/CCI-MOC/haas","labels_url":"https://api.github.com/repos/CCI-MOC/haas/issues/561/labels{/name}","comments_url":"https://api.github.com/repos/CCI-MOC/haas/issues/561/comments","events_url":"https://api.github.com/repos/CCI-MOC/haas/issues/561/events","html_url":"https://github.com/CCI-MOC/haas/pull/561","id":143558742,"number":561,"title":" Flask-SQLAlchemy and Database Migrations (try 2)","user":{"login":"henn","id":1813729,"avatar_url":"https://avatars.githubusercontent.com/u/1813729?v=3","gravatar_id":"","url":"https://api.github.com/users/henn","html_url":"https://github.com/henn","followers_url":"https://api.github.com/users/henn/followers","following_url":"https://api.github.com/users/henn/following{/other_user}","gists_url":"https://api.github.com/users/henn/gists{/gist_id}","starred_url":"https://api.github.com/users/henn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henn/subscriptions","organizations_url":"https://api.github.com/users/henn/orgs","repos_url":"https://api.github.com/users/henn/repos","events_url":"https://api.github.com/users/henn/events{/privacy}","received_events_url":"https://api.github.com/users/henn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CCI-MOC/haas/labels/Do%20not%20merge%20yet","name":"Do not merge yet","color":"FFC0CB"},{"url":"https://api.github.com/repos/CCI-MOC/haas/labels/Waiting%20on%20reviewer","name":"Waiting on reviewer","color":"999999"}],"state":"open","locked":false,"assignee":{"login":"zenhack","id":883774,"avatar_url":"https://avatars.githubusercontent.com/u/883774?v=3","gravatar_id":"","url":"https://api.github.com/users/zenhack","html_url":"https://github.com/zenhack","followers_url":"https://api.github.com/users/zenhack/followers","following_url":"https://api.github.com/users/zenhack/following{/other_user}","gists_url":"https://api.github.com/users/zenhack/gists{/gist_id}","starred_url":"https://api.github.com/users/zenhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenhack/subscriptions","organizations_url":"https://api.github.com/users/zenhack/orgs","repos_url":"https://api.github.com/users/zenhack/repos","events_url":"https://api.github.com/users/zenhack/events{/privacy}","received_events_url":"https://api.github.com/users/zenhack/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-03-25T18:14:24Z","updated_at":"2016-03-29T23:54:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CCI-MOC/haas/pulls/561","html_url":"https://github.com/CCI-MOC/haas/pull/561","diff_url":"https://github.com/CCI-MOC/haas/pull/561.diff","patch_url":"https://github.com/CCI-MOC/haas/pull/561.patch"},"body":"This is replacing #556, as for some reason github wasn't removing the merged commits and thus the diffs were bigger than they had to be.\r\n\r\nIan's (@zenhack) comments from #556:\r\n> This isn't quite ready yet, but it's worth having folks start looking at it. This is both moving over to the flask sqlalchemy extension and adding a database migration infrastructure. It includes a migration script that upgrades the content of my auth pr (#491) to the contents of the latest commit on this repository. Note that it does not handle upgrading the database for the OBM work that @SahilTikale did, since that was merged first.\r\n> \r\n> It also includes some changes to the travis stuff; we run tests/stress.py, and we run the tests against both sqlite and postgres.\r\n> \r\n> It does not yet include automated testing for the database migration infrastructure; I wanted to run my ideas about how to do that by you guys first:\r\n> \r\n>     Write a function like initial_db in tests/unit/api/auth.py (or just use that one), which populates a db with some useful objects.\r\n>     Before making any changes to the schema, use said script to populate a postgres database, then dump the database as a sql script (via pg_dump). Commit the result.\r\n>     Make your changes, and add a migration script.\r\n>     Testing will consist of:\r\n>         run the sql script to populate a (previously empty) database.\r\n>         run the migration script, to upgrade to the latest schema.\r\n>         run a series of tests that expect said initial database.\r\n> \r\n> I'm also still trying to pin down how the schema changes due to adding and removing extensions should work. Alembic has some support for branching and merging schema, but I need to do a bit more reading before I can decide what I think the right thing to do is there.\r\n> \r\n> I also need to write some developer docs describing how to do database migrations.\r\n> \r\n> @SahilTikale, @henn, let me know what you think.\r\n> "},"comment":{"url":"https://api.github.com/repos/CCI-MOC/haas/issues/comments/203161810","html_url":"https://github.com/CCI-MOC/haas/pull/561#issuecomment-203161810","issue_url":"https://api.github.com/repos/CCI-MOC/haas/issues/561","id":203161810,"user":{"login":"zenhack","id":883774,"avatar_url":"https://avatars.githubusercontent.com/u/883774?v=3","gravatar_id":"","url":"https://api.github.com/users/zenhack","html_url":"https://github.com/zenhack","followers_url":"https://api.github.com/users/zenhack/followers","following_url":"https://api.github.com/users/zenhack/following{/other_user}","gists_url":"https://api.github.com/users/zenhack/gists{/gist_id}","starred_url":"https://api.github.com/users/zenhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenhack/subscriptions","organizations_url":"https://api.github.com/users/zenhack/orgs","repos_url":"https://api.github.com/users/zenhack/repos","events_url":"https://api.github.com/users/zenhack/events{/privacy}","received_events_url":"https://api.github.com/users/zenhack/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T23:54:44Z","updated_at":"2016-03-29T23:54:44Z","body":"@gsilvis, would you have a look at this?"}}