Skip to content

Commit

Permalink
Merge pull request #2 from netlogix/feature/update-readme
Browse files Browse the repository at this point in the history
FEATURE: Update README.md
  • Loading branch information
saschanowak committed Jan 26, 2021
2 parents e0fc108 + c2d0cee commit 02fb619
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,51 @@

## About Netlogix Migrations

This package provides the ability to run migrations of the `netlogix/migrations` package asynchronously.
This package provides the ability to run migrations of the `netlogix/migrations` package ([Netlogix.Migrations](https://github.com/netlogix/Netlogix.Migrations)) asynchronously.

## Installation

`composer require netlogix/migrations-jobqueue`

## Configuration

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

```yaml
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](https://github.com/Flowpack/jobqueue-common))!


## Usage

Simply use the `AsyncMigration` interface in your migration:
```php
<?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.

0 comments on commit 02fb619

Please sign in to comment.