-- Draft vs published visibility for LMS lessons (mirrors lms_practices.publish_status).

ALTER TABLE lessons
    ADD COLUMN publish_status VARCHAR(16) NOT NULL DEFAULT 'PUBLISHED'
        CONSTRAINT chk_lessons_publish_status CHECK (publish_status IN ('DRAFT', 'PUBLISHED'));

-- New inserts default to draft unless the API sends PUBLISHED; existing rows stay published.
ALTER TABLE lessons
    ALTER COLUMN publish_status SET DEFAULT 'DRAFT';
