Skip to content

Commit

Permalink
Tweak event migration
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaidelich committed May 17, 2024
1 parent d4f40e3 commit b4e533d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\CreateRootNodeAggregateWithNode;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\UpdateRootNodeAggregateDimensions;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\ContentRepositoryRegistry\Command\MigrateEventsCommandController;
use Neos\ContentRepositoryRegistry\Factory\EventStore\DoctrineEventStoreFactory;
use Neos\EventStore\EventStoreInterface;
Expand Down Expand Up @@ -350,7 +351,11 @@ public function migratePayloadToWorkspaceName(\Closure $outputFn): void
continue;
}
$eventData = self::decodeEventPayload($eventEnvelope);
$this->updateEventPayload($eventEnvelope->sequenceNumber, [...$eventData, 'workspaceName' => $workspaceNamesByContentStreamId[$eventData['contentStreamId']]]);
$workspaceName = $workspaceNamesByContentStreamId[$eventData['contentStreamId']] ?? null;
if ($workspaceName === null) {
$workspaceName = WorkspaceName::fromString('missing');
}
$this->updateEventPayload($eventEnvelope->sequenceNumber, [...$eventData, 'workspaceName' => $workspaceName]);
$numberOfMigratedEvents++;
}
if ($numberOfMigratedEvents === 0) {
Expand Down

0 comments on commit b4e533d

Please sign in to comment.