Event type migrations
Event type migrations are shared Chronicle behavior. The shared documentation owns the migration model and client-tabbed examples.
TypeScript client notes
Section titled “TypeScript client notes”- Declare each generation as its own class with the same id, for example
@eventType('author-registered', 1)and@eventType('author-registered', 2), and connect them with an@eventTypeMigration(Newer, Older)class that implementsupcastanddowncast. Register every generation and the migration beforegetEventStore(...). - The kernel rejects a newer generation that has no migration from the previous one, so
getEventStore(...)fails instead of registering an incomplete chain. - Events already stored at an older generation are migrated by the kernel when the newer generation is registered. Reading the event log with the newest class, kernel projections and reactors that catch up or replay all receive the newest shape, with the original event source and sequence number.