定制 netsells/laravel-mutex-migrations 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

netsells/laravel-mutex-migrations

最新稳定版本:v3.0.0

Composer 安装命令:

composer require netsells/laravel-mutex-migrations

包简介

Run mutually exclusive migrations from more than one server at a time

README 文档

README

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

统计信息

  • 总下载量: 21.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-24