Yimaru-BackEnd/db/migrations/000080_lms_programs_learn_english_only.up.sql
Yared Yemane 26cf7d2908 feat: scope subscriptions by content type and make Duolingo plans lifetime
LEARN_ENGLISH plans unlock LMS only; IELTS and DUOLINGO unlock matching exam-prep catalog courses. Enable category subscription gating, restrict programs to Learn English, and treat Duolingo subscriptions as non-expiring one-time purchases.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 03:59:26 -07:00

14 lines
394 B
SQL

-- LMS programs are Learn English content only; exam prep uses exam_prep.catalog_courses.
UPDATE programs
SET
category = 'LEARN_ENGLISH',
updated_at = CURRENT_TIMESTAMP
WHERE category <> 'LEARN_ENGLISH';
ALTER TABLE programs
DROP CONSTRAINT IF EXISTS chk_programs_category;
ALTER TABLE programs
ADD CONSTRAINT chk_programs_category
CHECK (category = 'LEARN_ENGLISH');