netlogix/migrations-jobqueue

Last activity on 2 February 2021
  • 522
composer require netlogix/migrations-jobqueue

Run netlogix/migrations asynchronously using flowpack/jobqueue

1.0.1

Run netlogix/migrations asynchronously using flowpack/jobqueue

Homepage
http://websolutions.netlogix.de/
Version
1.0.1
Type
neos-package
Release Date
18.02.2021 09:24:05
Source
git
Distribution
zip
Requires
Requires (dev)
None
Suggest
None
Provides
None
Conflicts
None
Replaces
None
MIT 56830df90d3a924af5fa095dc069bbfba0cabcf6

Netlogix.Migrations.JobQueue

About Netlogix Migrations

This package provides the ability to run migrations of the netlogix/migrations package (Netlogix.Migrations) asynchronously.

Installation

composer require netlogix/migrations-jobqueue

Configuration

To run a migration asynchronously, the Queue to be used needs to be defined:

Netlogix:
  Migrations:
    JobQueue:
      queueName: 'nlx-migrations'

The queue (In this example nlx-migrations) must be configured in Flowpack.JobQueue.Common (Check Github for more info)!

Usage

Simply use the AsyncMigration interface in your migration:

<?php
declare(strict_types=1);

namespace Netlogix\Migrations\Persistence\Migrations;

use Netlogix\Migrations\JobQueue\Domain\Model\AsyncMigration;

class Version20210114172342 implements AsyncMigration
{

    public function up(): void
    {
        // ...
    }

    public function down(): void
    {
        // ...
    }

}

When ./flow migrations:migrate is run, the migration will instantly be marked as executed and an asynchronous job will be queued to the configured jobqueue.

The content of the readme is provided by Github
The same vendor provides 20 package(s).