4 ms·
For us, database migrations are a separate step, and we make sure to know whether a migration results in breakage. If it does, we take the app down first (with
by atombender 7y ago
For us, database migrations are a separate step, and we make sure to know whether a migration results in breakage.
If it does, we take the app down first (with a maintenance message) so that errors won't bubble up to the users and APIs.
If we need to roll back a deploy that has migrations, we just roll back the migration. Every migration requires a "down" step that reverses itself. Our Go apps use Goose [1], but there are many other solutions.
[1] https://github.com/pressly/goose https://github.com/pressly/goose