CREATE TABLE session_events (
    id         INTEGER PRIMARY KEY AUTOINCREMENT,
    session_id TEXT    NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
    timestamp  TEXT    NOT NULL,
    direction  INTEGER NOT NULL,
    data       BLOB    NOT NULL
);

CREATE INDEX idx_session_events_session_id ON session_events(session_id);
