https://github.com/stechstudio/laravel-locking-migrations
https://github.com/stechstudio/laravel-locking-migrations
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/stechstudio/laravel-locking-migrations
- Owner: stechstudio
- License: mit
- Created: 2019-12-19T02:37:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-19T02:43:48.000Z (over 6 years ago)
- Last Synced: 2025-02-08T05:27:46.848Z (over 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Locking migrations for Laravel
If your app deployment process deploys to multiple instances at the same time, and each of those attempts to run migrations, you can run into problems.
This package adds a `--lock` option to the `php artisan migrate` command, which will ensure only one server runs migrations at a time.
## Installation
Via Composer
``` bash
$ composer require stechstudio/laravel-locking-migrations
```
## Usage
In your composer.json `post-install-cmd` hook (or wherever you are running migrations during deploy) simply add the `--lock` option.
``` php
php artisan migrate --lock
```