andreo / eventsauce-migration-generator
This component generates doctrine migrations per aggregate.
Installs: 3 029
Dependents: 1
Suggesters: 1
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=8.2
- andreo/eventsauce-snapshotting: ^3.0
- doctrine/migrations: ^3.5
- doctrine/sql-formatter: ^1.1
- eventsauce/eventsauce: ^3.0
- eventsauce/message-repository-table-schema: ^0.4
- symfony/console: ^6.2
Requires (Dev)
- phpstan/phpstan: ^1.3
- phpunit/phpunit: ^9.4
- roave/security-advisories: dev-latest
README
Command to generate doctrine migrations per aggregate
Installation
composer require andreo/eventsauce-migration-generator
Previous versions doc
Requirements
- PHP >=8.2
- Symfony console ^6.0
Config doctrine migrations
In the first step, configure the doctrine migrations package
Usage
use Andreo\EventSauce\Doctrine\Migration\Command\GenerateDoctrineMigrationForEventSauceCommand; new GenerateDoctrineMigrationForEventSauceCommand( dependencyFactory: $dependencyFactory, // instance of Doctrine\Migrations\DependencyFactory );
Change table name suffix
use Andreo\EventSauce\Doctrine\Migration\Command\GenerateDoctrineMigrationForEventSauceCommand; use Andreo\EventSauce\Doctrine\Migration\Schema\TableNameSuffix; new GenerateDoctrineMigrationForEventSauceCommand( dependencyFactory: $dependencyFactory, tableNameSuffix: new TableNameSuffix(event: 'message_store') );
Generate command
andreo:eventsauce:doctrine-migrations:generate
Command options
prefix table name
- required
- string
Generate migration with foo prefix
php bin/console andreo:eventsauce:doctrine-migrations:generate foo
--schema=all
- optional
- string[]
- available values: event, outbox, snapshot, all
- default value: all
Generate migration for given schemas
php bin/console andreo:eventsauce:doctrine-migrations:generate foo --schema=event --schema=snapshot
--uuid-type=binary
- optional
- one of: binary, string
- default value: binary