1

In an EventFlow application, I want to completely remove an aggregate and transfer all of its events to another one. This resulting aggregate will have a different name, ID and events from the first one.

I have found this documentation about event upgrades using the IEventUpgrader class, but it requires that the incoming and resulting events have the same aggregate and id classes, so it will not solve my problem.

Browsing through the source code I found the "IEventUpgradeManager" class, that looks like it might work, but I was unable to find any documentation about it.

I could manually edit the metadata of each event inside the database, but that doesn't seem like a sustainable approach. What is the proper solution in this case?

Ian Esteves
  • 25
  • 1
  • 5

1 Answers1

0

Once You create NewAggregate and make it consume same old events by implementing IAmReadModelFor<NewAggregate NewAggreagateId, EventForOldAggregate>, won't it be re-aggregated? Then you can remove previous OldAggregate class from Code, the only rudiments shall be aggregate Snapshots in Db, but You can identify these in store and remove from there (do not know, what store You are using, but this is either table in RDBMs or Collection in NoSQL).