Table of contents
Perform concurrent doctrine migrations safely.
It hooks into Symfony's event system and listens for the doctrine:migrations:migrate
command to be executed.
The command must be executed with the --conn
option so that this bundle knows which connection to use.
If the platform of the selected connection is supported, the operation is performed inside a distributed lock.
Supported platforms:
- MySQL
- PostgreSQL
Add the bundle to your project.
composer require marein/symfony-lock-doctrine-migrations-bundle
Add the bundle in the kernel. This can be different for your setup.
public function registerBundles()
{
return [
// ...
new \Marein\LockDoctrineMigrationsBundle\MareinLockDoctrineMigrationsBundle(),
// ...
];
}
This is an example of all configurations in yaml format.
marein_lock_doctrine_migrations:
# Define a prefix for the name of the lock.
#
# Type: string
# Default: migrate__
lock_name_prefix: custom__
Only the bundle configuration is part of the public api. Everything else can change and is not considered a breaking change. Please don't use classes or services directly.