承接 aramayismirzoyan/laravel-safe-migrations 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

aramayismirzoyan/laravel-safe-migrations

最新稳定版本:v1.0.2

Composer 安装命令:

composer require aramayismirzoyan/laravel-safe-migrations

包简介

Tool for tracking uncontrolled migrations

README 文档

README

The Laravel Safe Migrations package helps you detect migrations you have changed but already exist in the remote repository. The package will also help you detect migrations that have been changed by other programmers but have already been migrated to your local environment. The package tracks changes based on Git.

Installation

composer require --dev aramayismirzoyan/laravel-safe-migrations

Commands

check:migrations

This command checks the migrations you changed, and they are already in the remote repository.

php artisan check:migrations

You can also specify specific branches and remotes. You must specify the remote branches on which you want to check for the existence of the migration. If you specify branches and remotes the check will be much faster.

php artisan check:migrations main branch2 --remote=origin --remote=local

To update data from a remote repository, set the --fetch flag.

php artisan check:migrations --fetch

check:migrated

The command checks if you have migrated migrations that have been changed by other programmers. The command checks the changes you have pulled using the git pull command.

php artisan check:migrated

If you do not specify a commit hash, then the commit you pulled using the git pull command will be checked. You can also specify the hash of the commit you want to check.

php artisan check:migrated commit_hash

GitHub Actions

You can also run migration checking on your GitHub Actions. You need to have this configuration:

    steps:
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.2'
    - uses: actions/checkout@v4
      with:
        fetch-depth: ${{ github.event_name == 'pull_request' && 2 }}
    - name: Install Dependencies
      run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
    - name: Check migrations
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: php artisan actions:migrations <main_branch>

In the php artisan actions:migrations command you need to pass your main branch as an argument. The check will only happen during a pull request and will check for migrations on the main branch. If there is at least one sensitive migration pipeline that will fail.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-24