by noise · 12y ago · 0 comments
1. deploy new code to prod
2. run migration on prod via a one-off dyno instance
However, in step 1 you are pushing code that relies on new tables/fields that don't yet exist, causing errors and likely downtime for the app.
To avoid this, you can instead have Alembic generate SQL from the migration and then apply that SQL to the prod DB directly prior to deploying the updated code.
It may be beneficial to update the post to specify the initial setup vs. migrations after the production env is setup. Or we could just add that in the next post.
Thanks!
In any case, good job on a well written set of posts.