Upgrading from V1 to V2
Upgrading from Projection V1 to ProjectionV2
The Problem
No Data Migration Needed
Upgrade Steps
1. Create the V2 Projection
#[Projection('ticket_list', Ticket::class)]
class TicketListProjection
{
#[EventHandler]
public function onTicketRegistered(TicketWasRegistered $event): void
{
$this->connection->insert('ticket_list', [
'ticket_id' => $event->ticketId,
'ticket_type' => $event->type,
'status' => 'open',
]);
}
#[ProjectionInitialization]
public function init(): void { /* CREATE TABLE ticket_list */ }
}2. Initialize and Backfill
3. Verify
4. Switch Traffic
What Changes Between V1 and V2
Last updated
Was this helpful?