tia/drizzle/meta/_journal.json
Mannu 714909d7ee feat(billing): Task 1 — Razorpay subscription schema + migration
Three tables + lifecycle enum for Razorpay subscriptions:
- subscription_plans: maps razorpay_plan_id -> grants (price/storage/member/child)
- family_subscriptions: per-family sub state mirrored from Razorpay
- razorpay_webhook_events: append-only log, razorpay_event_id = idempotency key
- subscription_status_enum: mirrors Razorpay's lifecycle states exactly
- partial unique index family_live_sub_idx: at most one non-terminal sub/family

Notes:
- Raw-SQL + Drizzle schema both added (repo uses raw sql`` at runtime;
  schema file keeps drizzle-kit + type inference working)
- child_limit added to plan (not in original handoff) since premium lifts the
  free 1-baby cap to 3 per product decision
- Migration 0012 idempotent; also added to debug-migration hot-apply steps
- when=1780100000000 (> last entry, per journal drift rule)

Entitlement will sync onto families.tier (Task 3/5) so existing quota.ts
guards stay unchanged — these tables are audit + Razorpay state mirror.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 12:10:53 +05:30

97 lines
No EOL
1.9 KiB
JSON

{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1779518962214,
"tag": "0000_baseline_prod_2026_05_19",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1779538936553,
"tag": "0001_wardrobe_tables",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1779539431897,
"tag": "0002_outfits_table",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1748134800000,
"tag": "0003_circles",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1748221200000,
"tag": "0004_circle_invite_email",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1748307600000,
"tag": "0005_email_verification",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1748394000000,
"tag": "0006_family_invites_missing_cols",
"breakpoints": true
},
{
"idx": 7,
"version": "7",
"when": 1748480400000,
"tag": "0007_subscription_status",
"breakpoints": true
},
{
"idx": 8,
"version": "7",
"when": 1748566800000,
"tag": "0008_pediatrician_name",
"breakpoints": true
},
{
"idx": 9,
"version": "7",
"when": 1748880000000,
"tag": "0009_notifications",
"breakpoints": true
},
{
"idx": 10,
"version": "7",
"when": 1749139200000,
"tag": "0010_error_events",
"breakpoints": true
},
{
"idx": 11,
"version": "7",
"when": 1780000000000,
"tag": "0011_user_phone",
"breakpoints": true
},
{
"idx": 12,
"version": "7",
"when": 1780100000000,
"tag": "0012_billing",
"breakpoints": true
}
]
}