CREATE TABLE IF NOT EXISTS issue_reference (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    issue UUID NOT NULL REFERENCES issue(id),
    target_type TEXT NOT NULL,
    target_id UUID NOT NULL,
    created_by UUID NOT NULL,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
