CREATE TABLE IF NOT EXISTS pull_request_review_comment (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    pull_request UUID NOT NULL REFERENCES pull_request(id),
    review UUID REFERENCES pull_request_review(id),
    author UUID NOT NULL,
    body TEXT NOT NULL,
    path TEXT NOT NULL,
    commit_sha TEXT NOT NULL,
    original_commit_sha TEXT,
    line INTEGER,
    original_line INTEGER,
    side TEXT,
    resolved BOOLEAN NOT NULL DEFAULT FALSE,
    resolved_by UUID,
    resolved_at TIMESTAMPTZ,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    deleted_at TIMESTAMPTZ
);
