home / chat

msc4242_state_dag_edges

0 rows where prev_state_event_id = 1848

✎ View and edit SQL

This data as json

0 records

CREATE TABLE msc4242_state_dag_edges(
    -- Deleting the room deletes the state DAG.
    room_id TEXT NOT NULL REFERENCES rooms(room_id) ON DELETE CASCADE,
    -- the event IDs being referenced must exist (hence REFERENCES) and we do not want to accidentally delete
    -- the event and create a hole in the state DAG. It is not possible for a state
    -- DAG room to function with an holey DAG, so these events _cannot_ be purged. To purge them, the
    -- entire room would need to be deleted.
    event_id TEXT NOT NULL REFERENCES events(event_id),
    -- one of the `prev_state_events` for this event ID. We must have it since we must have the entire state DAG.
    -- can be NULL for the create event.
    prev_state_event_id TEXT REFERENCES events(event_id)
);
CREATE UNIQUE INDEX msc4242_state_dag_edges_key ON msc4242_state_dag_edges(room_id, event_id, prev_state_event_id);
Powered by Datasette · Queries took 106.725ms