Closed paulkre closed 1 year ago
Same goes for aggregate snapshots. If you add an attribute to an aggregate that has been persisted in a snapshot before, it will cause an error when that snapshot is being loaded. We probably need upcasting for snapshots and views too, right?
You are correct. The usual way to handle that is to truncate your views table and replay all events.
Snapshots will need to be dropped as well. Though you will not need to replay events as the framework will load all events and rebuild the snapshot on the first new command.
How can I modify
View
structs reliably? If I have aView
for anAggregate
with thousands of instances, and I decide to add an attribute to the view struct, this new attribute will only exist on the instances, that have been updated after the code change. The only way to update all view instances would be to drop the entire view table and replay every event for the view query, right?