You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.
Today we had an small amount of downtime when a migration was not run against the production database before pushing the application code to production. How can we prevent this from happening in the future?
The text was updated successfully, but these errors were encountered:
I might be wrong, but I thought the point of Knex migrations was to automatically update schemas when they change without losing data. If this is true, we should be able to add that as a step to the deploy process no? Are we using Knex incorrectly?
What is the deployment process right now? It sounds like we're missing the migration step when moving from staging to production. I don't see a postinstall script in the package.json, so it might be that we just need to add a postinstall call for npm run migrate (rather than npm run knex, which runs migrate+seed, the latter of which is not very useful to run every time a prod push happens), so that instance that already have an .env file or heroku vars, with a working database attached, get automigrated.
@sedge As we've learned, depends how you code your migrations! :) But generally speaking, yes, migrations should be safe to run at all times. And unsafe migrations should be caught/changed in code review.
@Pomax Heroku auto deploys master to staging and there's a human-pressed promotion button to production
Today we had an small amount of downtime when a migration was not run against the production database before pushing the application code to production. How can we prevent this from happening in the future?
The text was updated successfully, but these errors were encountered: