-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Deleting event streams #157
Comments
No, it's not supported yet. I can add it as a feature request. For example, Greg Young's Event Store supports soft and hard deletion of streams.
There are Postgres rules on the events tables to prevent updates and deletes. You would need to drop those rules before attempting to delete any events. DROP RULE no_update_stream_events ON stream_events;
DROP RULE no_delete_stream_events ON stream_events;
DROP RULE no_update_events ON events;
DROP RULE no_delete_events ON events; Be warned that deleting events will break the event store. My recommendation would be to replace the events with empty data and set the event type as a deleted event struct (e.g. UPDATE events
SET
event_type = 'Elixir.MyApp.DeletedEvent',
data = convert_to('{}', current_setting('server_encoding')),
metadata = convert_to('{}', current_setting('server_encoding'))
WHERE event_id = '<event_id>'; You would need to define a deleted event module: defmodule MyApp.DeletedEvent do
defstruct [:data]
end |
I'd be interesting in that as well, as deleting streams can be a good approach for handling data, which are required to be deletable by law. |
Closing this issue. I've added a new "Event stream deletion" feature proposal in #170. |
From what I've seen there's no way to delete event streams, is that right?
I guess I can always do it manually be removing the proper records from the underlying database.
I know that conceptually events should never be removed. However I'm migrating a legacy system from which I import events. So as the development is making progress, I find myself re-importing these events from the legacy system over and over.
The text was updated successfully, but these errors were encountered: