[
  {
    "createIndexes": "usage_prefs",
    "indexes": [
      { "key": { "uid": 1 }, "name": "unique_usage_prefs_uid", "unique": true },
      { "key": { "stripe_customer_id": 1 }, "name": "unique_stripe_customer", "unique": true, "sparse": true },
      { "key": { "stripe_subscription_id": 1 }, "name": "unique_stripe_subscription", "unique": true, "sparse": true }
    ]
  },
  {
    "createIndexes": "billing_checkout_attempts",
    "indexes": [
      { "key": { "uid": 1, "request_id": 1 }, "name": "unique_checkout_request", "unique": true },
      { "key": { "session_id": 1 }, "name": "unique_checkout_session", "unique": true, "sparse": true }
    ]
  },
  {
    "createIndexes": "billing_webhook_events",
    "indexes": [
      { "key": { "stripe_event_id": 1 }, "name": "stripe_webhook_event_id", "unique": true }
    ]
  },
  {
    "createIndexes": "usage_purchases",
    "indexes": [
      { "key": { "stripe_event_id": 1 }, "name": "unique_purchase_stripe_event", "unique": true, "sparse": true },
      { "key": { "stripe_session_id": 1 }, "name": "purchase_stripe_session", "sparse": true },
      { "key": { "stripe_subscription_id": 1 }, "name": "purchase_stripe_subscription", "sparse": true }
    ]
  }
]
