-- Front 8.5: what the art grade decides, set in the Kanban's Site tab. No row -- means no rule, and nothing changes; each action has at most one threshold. CREATE TABLE IF NOT EXISTS dtf_local.grade_rules ( action text PRIMARY KEY CHECK (action IN ('aviso','tratamento')), below integer NOT NULL CHECK (below BETWEEN 1 AND 100), updated_by text NOT NULL, updated_at timestamptz NOT NULL DEFAULT now() );