quantick/deploy-migrations

Deploy migration commands

v1.0.13 2022-09-02 12:45 UTC

README

Scrutinizer Code Quality Build Status codecov Build Status

Installation

You can install the package via composer:

composer require quantick/deploy-migrations

The package will automatically register itself.

You can publish config and migration with:

php artisan vendor:publish --provider="Quantick\DeployMigration\DeployMigrationServiceProvider"

In config/deploy-migration.php сonfigure the path to the directory with migrations. By default it will be deploy/migrations

How to use

  1. Generate migration via command:
php artisan make:deploy-migration

It will create migration class in your project.

  1. Next configure getCommands method:
<?php


class Version20190211093348 extends \Quantick\DeployMigration\Lib\DeployMigration {

    public function getCommands(): array
    {
        return [
            \App\Console\Commands\TestCommandWithArguments::class => ['arg' => 'value', '--option' => true],
            \App\Console\Commands\TestCommandWithoutArguments::class => [],
            function (SomeService $service) {
                return $service->doTheWork();
            }
        ];
    }
}
  1. Run
php artisan deploy:migrate