Skip to content

Commit

Permalink
Also store aggregate root version when one event is persisted
Browse files Browse the repository at this point in the history
  • Loading branch information
brendt committed Apr 21, 2021
1 parent a830bb8 commit 06c28c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-event-sourcing` will be documented in this file:

## 4.10.1 - 2021-04-21

- Also store aggregate root version when one event is persisted

## 4.10.0 - 2021-04-21

- Deprecate `AggregateRoot::$allowConcurrency`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function persist(ShouldBeStored $event, string $uuid = null, int $aggrega
$eloquentStoredEvent->setRawAttributes([
'event_properties' => app(EventSerializer::class)->serialize(clone $event),
'aggregate_uuid' => $uuid,
'aggregate_version' => $aggregateVersion,
'aggregate_version' => $event->aggregateRootVersion() ?? $aggregateVersion,
'event_class' => $this->getEventClass(get_class($event)),
'meta_data' => json_encode($event->metaData()),
'created_at' => Carbon::now(),
Expand Down

0 comments on commit 06c28c7

Please sign in to comment.