-- 344_documents_law_jurisdiction_check.sql -- 안전 자료실 분류 축 A-1 (5/12) — 나라 혼선 금지를 구조로 강제. -- 법령(material_type='law')인데 jurisdiction NULL 인 행은 적재 자체가 거부된다. -- 업로드 승인 경로는 proposed_jurisdiction 필수 입력 (KR 기본값 오염 금지 — plan A-2). -- material_type 이 NULL 이면 식 전체가 NULL = CHECK 통과 (비법령 무영향). ALTER TABLE documents ADD CONSTRAINT chk_documents_law_jurisdiction CHECK (material_type <> 'law' OR jurisdiction IS NOT NULL);