fervo / release-phase-migrations-bundle
A bundle to run release-phase migrations on Heroku
Installs: 32 010
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 5
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: ~5.3|~7.0|~8.0
- doctrine/dbal: ~2.5
- doctrine/doctrine-migrations-bundle: ^1.2|^2.0
- fervo/advisory-locker: ^1.0.0
- symfony/console: ~2.7|~3.0|~4.0|~5.0
- symfony/framework-bundle: ~2.7|~3.0|~4.0|~5.0
This package is auto-updated.
Last update: 2024-10-25 18:00:17 UTC
README
Bundle installation
Install as per usual. The bundle requires DoctrineMigrationBundle. Because this bundle is still being tried out by us internally, we're reluctant to release better instructions on how to use it. While both the library and the bundle is released as 1.0.0, this is mainly because we want to be able to strictly version it using semver. Once we've used this in production for a while, we'll go ahead and update these instructions.
Why use this instead of just using Doctrine Migrations
This bundle is just a thin wrapper around Doctrine Migrations. The only difference is that before we start migrating, (as per Heroku's recommendation) we try to acquire an advisory lock on the database. If we fail to get that lock, the migration will not be performed, and (if you're using this for release phase migrations), the release will fail.
Using the bundle
Add the following to your Procfile:
release: php bin/console fervo:release-phase-migrations:migrate --allow-no-migration -n
That's it?
Sort of. If you want to make sure your deploys are zero downtime, there are two things you need to do:
- Enable preboot. All the usual caveats for using preboot still apply: https://devcenter.heroku.com/articles/preboot#caveats
- Make sure all of your migrations are backwards compatible, i.e. that your old codebase can still run on the migrated database. Depending on what you're doing, this can be a pretty severe restriction.