Let's say I have an existing aggregate CustomAggregate
and an event CustomEvent
which is handled by the aggregate.
After some time when the event store already contains some events for this aggregate, I need to rename the aggregate and the event to NewCustomAggregate
and NewCustomEvent
. I update the revision of the renamed event and create a corresponding upcaster which is handling the event renaming.
But the type
in the table which serves as an event store still refers to CustomAggregate
. Hence, when I'm trying to get all events for the new aggregate type like this
eventStore.readEvents("NewCustomAggregate", id);
I'm (obviously) getting an exception saying that there are no events for this aggregate type.
Is there a way to not only consider the renamed/changed events in the upcaster, but also take into consideration that for certain event revisions the event store should treat the NewCustomAggregate
type as CustomAggregate
?
The Axon version I use is 2.4.6.