-- 212_md_draft_status_check.sql
-- Phase 1A: md_draft_status 사용 조건 — content_origin='ai_drafted' 일 때만 NOT NULL 허용.

ALTER TABLE documents
    ADD CONSTRAINT documents_md_draft_status_only_ai
    CHECK (md_draft_status IS NULL OR content_origin = 'ai_drafted');
