Skip to main content
v2.6 sits beside v2.3 in the same namespace. Your v2_3_* tables keep updating while you move, so you can run old and new queries side by side and compare them before you switch.

Why move

v2.6 publishes the same objects the API returns, so its numbers match the API. Three v2.3 problems go away:
  • Balances no longer count old plans. v2_3_balances added up every grant a customer ever had, including ended plans and past cycles, so you had to filter them out. v2_6_balances contains only what the API counts.
  • Rollovers are included. v2_3_balances left rollovers out. In v2.6 they are part of the balance and listed in v2_6_rollovers.
  • Subscriptions keep their real status. v2_3_subscriptions.status showed every non-active plan as scheduled. v2_6_subscriptions.status is the real status: expired, trialing, paused and so on.

What changes in your queries

  1. Table prefix. v2_3_ becomes v2_6_. events is unchanged.
  2. Product is now plan. Every internal_product_id becomes internal_plan_id, and internal_customer_product_id becomes customer_plan_id. (events.internal_product_id keeps its name.)
  3. Keys are named after their table. v2.3’s generic internal_id becomes internal_customer_id, internal_plan_id, customer_plan_id and so on, and references use the same name, so a join reads s.internal_plan_id = p.internal_plan_id.
  4. Balances have one row per view. Add scope = 'customer' to customer-level balance queries. See below.
  5. Drop your balance filters. The active-plan, current-cycle and expiry filters you applied to v2.3 balances are already applied.
  6. Arrays are JSON text. v2.3 had a few array columns (plan_ids, product_ids, internal_product_ids). In v2.6 every array is a JSON string; see Querying → JSON columns.

Tables

Renamed keys

Balances now have one row per view

In v2.3, each grant appeared once, under whichever scope it had: customer-level grants on rows with no entity_id, entity-level grants on rows with one. In v2.6 each balance is computed separately for the customer and for every entity, the way the API does it, and an entity’s view also includes the customer-level grants it can use. So the v2.3 habit of summing every row now over-counts. Read Working with balances for the worked example.

Before and after

A customer’s current balance for one feature, including rollovers. v2.3: filter to active plans and the current cycle, then add unexpired rollovers yourself.
v2.6: read the row.

Checklist

  1. Run your v2.3 queries and their v2.6 versions side by side for a few customers and compare.
  2. Change the table prefix, then rename keys using the table above.
  3. Replace internal_product_id and internal_customer_product_id with internal_plan_id and customer_plan_id.
  4. In balance queries, delete your active/current-cycle/rollover logic and add a scope filter.
  5. Where you filtered status = 'scheduled' to mean “not active”, use the real statuses.
  6. Parse array columns as JSON.
  7. Tell us when you’ve moved, so we can retire your v2.3 tables.