Files
pargar/backend/internal/db/migrations/0030_lesson_draft_status.sql
T

10 lines
479 B
SQL
Raw Normal View History

-- Add draft/published state to chapters and lessons.
-- Existing content is published immediately so nothing goes dark on deploy.
-- New lessons created via the admin API default to is_published = false (draft).
ALTER TABLE lessons ADD COLUMN IF NOT EXISTS is_published BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE chapters ADD COLUMN IF NOT EXISTS is_published BOOLEAN NOT NULL DEFAULT false;
UPDATE lessons SET is_published = true;
UPDATE chapters SET is_published = true;