-
Notifications
You must be signed in to change notification settings - Fork 5
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
Consider setting up Alembic for Data Migrations #584
Comments
Alembic has now been set up in the dev version of the database. The next step would be to set up the in-app startup logic in v2 production (and stage as well). Because this has already been done in the Source Collector App, we do have a framework for which to do this. The plan for this would be as follows:
Edit: How we run the migrations has changed, see comments below. Footnotes
|
@maxachis obstacle number 1 seems like a hidden blessing to me, anyway! |
The Data Source API has been containerized, and successfully set up on The current alembic migration logic will likely need modifying, but how it's modified will differ depending on if we're doing stage or production: StageBecause the stage database will regularly refresh from production, we need to be able to apply that alembic migration after the refresh has occurred. Thus, the Jenkins ProductionBecause production will be the source of truth, we want alembic migrations to occur in a way that is synchronized with the app updates. That will likely require a GitHub action (perhaps one which triggers a Jenkins job, just to keep things consistent) that activates following a push into main. |
The alembic migrations have been tested successfully on Stage! I added a small alembic migration, and the combination of the automation jobs and app logic caused it to show up in the stage database. Woohoo 🎉 At this point, all that remains is prod. I've set up an automation job for Prod Alembic migration, which would run right after a v1 to v2 migration, but I can't run it yet because the latest version of v2 main doesn't have the alembic changes. So here are the steps remaining:
|
Having learned a number of lessons from the initial database migration setup, I think it's worth converting to Alembic.
Rationale is as follows:
Obstacles/Required Steps
The text was updated successfully, but these errors were encountered: