Download the PHP package netsells/laravel-mutex-migrations without Composer
On this page you can find all versions of the php package netsells/laravel-mutex-migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download netsells/laravel-mutex-migrations
More information about netsells/laravel-mutex-migrations
Files in netsells/laravel-mutex-migrations
Package laravel-mutex-migrations
Short Description Run mutually exclusive migrations from more than one server at a time
License MIT
Informations about the package laravel-mutex-migrations
Mutex Migrations for Laravel
Run mutually exclusive migrations from more than one server at a time.
Using Laravel's functionality for Atomic Locks, this package extends the built-in MigrateCommand
class to allow migrations to be run safely when there is the chance that they may be run concurrently against the same database.
Installation
Install the package with:
composer require netsells/laravel-mutex-migrations
Optionally publish the package config file:
php artisan vendor:publish --tag=mutex-migrations-config
Usage
Running a mutex migration using the default database
store requires the existence of a table to store cache locks. If it does not exist the command will automatically fallback to a standard migration.
php artisan migrate --mutex
If two or more migrations happen to run concurrently, the first to acquire a lock will block the next one from running until it has finished, or until the lock times out - after 60 seconds, by default.
Testing
./vendor/bin/phpunit
All versions of laravel-mutex-migrations with dependencies
illuminate/contracts Version ^10.0|^11.0
illuminate/console Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0