feat: event store — persist domain events to Postgres event_log table via composite publisher
This commit is contained in:
10
crates/adapters/postgres/migrations/010_event_log.sql
Normal file
10
crates/adapters/postgres/migrations/010_event_log.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE IF NOT EXISTS event_log (
|
||||
event_id BIGSERIAL PRIMARY KEY,
|
||||
aggregate_id UUID NOT NULL,
|
||||
event_type TEXT NOT NULL,
|
||||
payload JSONB NOT NULL,
|
||||
occurred_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
CREATE INDEX idx_event_log_aggregate ON event_log (aggregate_id);
|
||||
CREATE INDEX idx_event_log_type ON event_log (event_type);
|
||||
CREATE INDEX idx_event_log_occurred ON event_log (occurred_at);
|
||||
Reference in New Issue
Block a user