Closed bruli closed 4 years ago
Yes, I have the same problem
Commands was remove from bundle. We need create event table using a migration tool or similar. But the problem is in documentation. Anything was write about it.
For now I wrote a Doctrine migration. Since I'm just trying out Broadway for the first time I have no experience and the schema might be stupid. E.g. uuids should be stored different or smth like that?!
But if somebody wants to hack around: my migration looks like that.
$table = $schema->createTable('event_store');
$table->addColumn('uuid', Type::STRING, [
'length' => 36,
'fixed' => true,
]);
$table->addColumn('playhead', Type::INTEGER, [
'unsigned' => true,
]);
$table->addColumn('payload', Type::TEXT);
$table->addColumn('metadata', Type::TEXT);
$table->addColumn('recorded_on', Type::STRING, [
'length' => 32,
]);
$table->addColumn('type', Type::TEXT);
$table->addUniqueIndex(['uuid', 'playhead']);
$table->setPrimaryKey(['uuid']);
@bruli, seems like the bundle at ver. 0.4.0 still has the commands, while the new version doesn't; so you could require broadway/broadway
at an earlier version (1.x
), as well as the bundle at 0.4.0
specifically:
$ composer require broadway/broadway ^1.0
$ composer require broadway/broadway-bundle 0.4.0
@wjzijderveld should we revert this? https://github.com/broadway/broadway-bundle/pull/50/commits/5cc22d5dce4f498c96886f83be53e7838e3130cc
This means adding a dependency on Doctrine. (Arguably just a dev dependency.) Adding these commands to broadway/event-store-dbal requires adding a dependency on symfony/console in that repo.
I'm not sure, I think it's a bad example to not do it with migrations. But then again, I would also prefer to have a lower entry barrier :-) Maybe add it to the demo instead and link to there in the docs?
FWIW, example of migration file is available at: https://gist.github.com/arrgson/a8a8163c92995696d4b182011e1e3c0a
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi.
I'm installed Broadway bundle in a symfony4 project. But I can't execute broadway commands to create event store schema.
I've got installed:
Registered bundle:
In config/packages/broadway.yaml
In config/services.ymal
Any idea why I can see commands?. Thks.