CREATE TABLE IF NOT EXISTS issue (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    wk UUID NOT NULL,
    number BIGINT NOT NULL,
    title TEXT NOT NULL,
    body TEXT,
    state TEXT NOT NULL DEFAULT 'open',
    priority TEXT NOT NULL DEFAULT 'medium',
    author UUID NOT NULL,
    closed_by UUID,
    closed_at TIMESTAMPTZ,
    due_at TIMESTAMPTZ,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    deleted_at TIMESTAMPTZ
);
