RezinaLMS-BackEnd/db/migrations/000099_ielts_lifetime_subscriptions.up.sql
Yared Yemane 342b10a35a Treat IELTS and DUOLINGO subscriptions as lifetime one-time plans.
Extend the DUOLINGO far-future expires_at pattern to IELTS, backfill existing IELTS rows, and limit expiry sweeps to LEARN_ENGLISH only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 02:23:23 -07:00

10 lines
330 B
SQL

-- IELTS 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 = 'IELTS'
AND us.expires_at < TIMESTAMPTZ '9999-01-01 00:00:00+00';