-- Transcript editing (Otter Wave 1): segment-level text fixes + per-segment
-- speaker overrides, always logged — who changed what, from what, to what.
-- The edit ripples: plain_text rebuilt, the segment's stale word timings
-- dropped (word features degrade to segment anchors there), entities
-- re-resolved, search windows re-embedded.
-- Live PG < 9.5: plain CREATE INDEX. Also folded into 2026_07_13_meetings_combined.sql.

CREATE TABLE IF NOT EXISTS meeting_edits (
    id          varchar(32) NOT NULL PRIMARY KEY,
    meeting_id  varchar(32) NOT NULL,
    company     varchar(32) NOT NULL,
    seg_index   integer     NOT NULL,
    old_text    text,
    new_text    text,
    old_speaker varchar(64),
    new_speaker varchar(64),
    edited_by   varchar(32),
    created     timestamp   NOT NULL DEFAULT now()
);

CREATE INDEX idx_medits_meeting ON meeting_edits (meeting_id);
