-- Meetings: semantic search vectors. One row per transcript segment; vec is
-- base64 little-endian float32[384] (bge-small, L2-normalized) computed by the
-- worker during batch transcription. Live PG < 9.5 (no pgvector ever on this
-- box): similarity = dot product in PHP over the company's vectors.

CREATE TABLE IF NOT EXISTS meeting_segment_vectors (
    meeting_id varchar(32) NOT NULL,
    seg_index  integer     NOT NULL,
    company    varchar(32) NOT NULL,
    s          numeric(9,2),
    e          numeric(9,2),
    vec        text        NOT NULL,
    created    timestamp   NOT NULL DEFAULT now(),
    PRIMARY KEY (meeting_id, seg_index)
);

CREATE INDEX idx_msv_company ON meeting_segment_vectors (company);
