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>
10 lines
330 B
SQL
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';
|