andreo / eventsauce-migration-generator
该组件根据聚合生成doctrine迁移。
3.2
2023-02-25 15:58 UTC
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
生成每个聚合的doctrine迁移的命令
安装
composer require andreo/eventsauce-migration-generator
旧版本文档
需求
- PHP >=8.2
- Symfony console ^6.0
配置doctrine迁移
在第一步,配置doctrine迁移包
用法
use Andreo\EventSauce\Doctrine\Migration\Command\GenerateDoctrineMigrationForEventSauceCommand; new GenerateDoctrineMigrationForEventSauceCommand( dependencyFactory: $dependencyFactory, // instance of Doctrine\Migrations\DependencyFactory );
更改表名后缀
use Andreo\EventSauce\Doctrine\Migration\Command\GenerateDoctrineMigrationForEventSauceCommand; use Andreo\EventSauce\Doctrine\Migration\Schema\TableNameSuffix; new GenerateDoctrineMigrationForEventSauceCommand( dependencyFactory: $dependencyFactory, tableNameSuffix: new TableNameSuffix(event: 'message_store') );
生成命令
andreo:eventsauce:doctrine-migrations:generate
命令选项
表名前缀
- 必需
- 字符串
使用 foo 前缀生成迁移
php bin/console andreo:eventsauce:doctrine-migrations:generate foo
--schema=all
- 可选
- 字符串数组
- 可用值:event, outbox, snapshot, all
- 默认值:all
为给定架构生成迁移
php bin/console andreo:eventsauce:doctrine-migrations:generate foo --schema=event --schema=snapshot
--uuid-type=binary
- 可选
- 以下之一:binary, string
- 默认值:binary