-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Alembic for migrations #801
Conversation
5239566
to
b5931ee
Compare
I'm not too familiar with Alembic. Could you walk me through what a database migration looks like in this new world? Review status: 0 of 11 files reviewed at latest revision, 6 unresolved discussions, all commit checks successful. alembic/env.py, line 1 [r1] (raw file): alembic/versions/README.md, line 1 [r1] (raw file): DEVELOP.md, line 58 [r1] (raw file): DEVELOP.md, line 200 [r1] (raw file): schema.py, line 3 [r1] (raw file): scripts/init_db.py, line 43 [r1] (raw file): Comments from the review on Reviewable.io |
b5931ee
to
a5f3c13
Compare
The steps are 1) Make a migration script containing the migration instructions for the change 2) Run the script using alembic. Alembic keeps track of which upgrades you've run by tracking the most recent migration's GUI in the DB (the "stamp" you ask about below). cf http://alembic.readthedocs.org/en/latest/tutorial.html#create-a-migration-script for a short concrete example. Review status: 0 of 11 files reviewed at latest revision, 6 unresolved discussions, all commit checks successful. alembic/env.py, line 1 [r1] (raw file): alembic/versions/README.md, line 1 [r1] (raw file): DEVELOP.md, line 58 [r1] (raw file): DEVELOP.md, line 200 [r1] (raw file): schema.py, line 3 [r1] (raw file): scripts/init_db.py, line 43 [r1] (raw file): Comments from the review on Reviewable.io |
Cool, this seems relatively painless & a clear win over our current manual process. What's the migration process from our current Alembic-less setup to the new world? Let's do a Cycledash deploy & get this in place today before we all start going on vacation. Review status: 0 of 11 files reviewed at latest revision, 2 unresolved discussions, some commit checks broke. scripts/init_db.py, line 2 [r2] (raw file): scripts/init_db.py, line 43 [r1] (raw file): Comments from the review on Reviewable.io |
There is no migration process whatsoever! Review status: 0 of 11 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending. scripts/init_db.py, line 43 [r1] (raw file): Comments from the review on Reviewable.io |
a5f3c13
to
d4eca99
Compare
d4eca99
to
22a8940
Compare
…ations Use Alembic for migrations
Fixes #776
cc @danvk