How to rewrite a stream? #1911
Unanswered
gs-jdudulski
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have rather a common problem, that I want to upcast (or remove) some events from the stream. A recommended way for migration is copy-and-replace. On the basic level it is rather obvious how to do this:
The problem is how to do this if you want to preserve the stream name? (or maybe I should not look at it that way?)
Just run it twice (copy to temp stream, delete original stream, copy back to proper stream)?
How to make sure that when deleting the stream, there are no new events (maybe we should have something like
delete_stream(name, expected_version:)
🤔 )?I know there is a way to rewrite events https://railseventstore.org/docs/advanced-topics/migrating-existing-events but wonder how to approach with immutable events in mind. Plus it won't handle case where you want to merge or split events.
Beta Was this translation helpful? Give feedback.
All reactions