Yimaru-BackEnd/db/migrations/000079_duolingo_lifetime_subscriptions.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

10 lines
336 B
SQL

-- DUOLINGO subscriptions are one-time purchases with no real expiry.
UPDATE user_subscriptions us
SET
expires_at = TIMESTAMPTZ '9999-12-31 23:59:59+00',
updated_at = CURRENT_TIMESTAMP
FROM subscription_plans sp
WHERE us.plan_id = sp.id
AND sp.category = 'DUOLINGO'
AND us.expires_at < TIMESTAMPTZ '9999-01-01 00:00:00+00';