CREATE TABLE IF NOT EXISTS room_message (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    room UUID NOT NULL REFERENCES room(id),
    seq BIGINT NOT NULL,
    thread UUID,
    parent UUID,
    author UUID NOT NULL,
    content TEXT NOT NULL,
    content_type TEXT NOT NULL DEFAULT 'text',
    pinned BOOLEAN NOT NULL DEFAULT FALSE,
    edited_at TIMESTAMPTZ,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    deleted_at TIMESTAMPTZ
);
