From b0f6de0e8b31c6fe2a3c5f1f0d91deeeb90f0e15 Mon Sep 17 00:00:00 2001 From: lorentz Date: Fri, 10 Jul 2026 19:37:16 -0400 Subject: [PATCH] feat(11-01): add PAX8 subscription cost columns (migration 092) - ALTER TABLE pax8_subscriptions to add price/partner_cost/currency - Additive, idempotent (IF NOT EXISTS), matches currency convention from 091 - Applied to dev DB via docker exec (Postgres init won't re-run on existing volume) --- migrations/092_pax8_subscription_costs.sql | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 migrations/092_pax8_subscription_costs.sql diff --git a/migrations/092_pax8_subscription_costs.sql b/migrations/092_pax8_subscription_costs.sql new file mode 100644 index 0000000..c30ed41 --- /dev/null +++ b/migrations/092_pax8_subscription_costs.sql @@ -0,0 +1,20 @@ +-- PAX8 subscription cost columns. +-- +-- PAX8's Subscription object (GET /subscriptions?page=&size=, Phase 11 +-- research, devx.pax8.com findsubscriptions) exposes both a customer/list +-- `price` and a partner/reseller `partnerCost` per subscription, plus a +-- `currencyCode`. Migration 091 did not model these — this migration adds +-- them as additive columns on the existing pax8_subscriptions table (D-03). +-- +-- Raw per-billing-period amounts are stored exactly as PAX8 returns them, +-- paired with the existing billing_term column. Monthly normalization is a +-- read-time concern, not modeled here (D-04). + +ALTER TABLE pax8_subscriptions + ADD COLUMN IF NOT EXISTS price NUMERIC(12,2); + +ALTER TABLE pax8_subscriptions + ADD COLUMN IF NOT EXISTS partner_cost NUMERIC(12,2); + +ALTER TABLE pax8_subscriptions + ADD COLUMN IF NOT EXISTS currency CHAR(3) NOT NULL DEFAULT 'USD';