collab: Record cancellation reason on billing subscriptions (#22853)

This PR updates the `billing_subscriptions` in the database to record
the cancellation reason from Stripe.

We're primarily interested in this so we can check for subscriptions
that were canceled for being `past_due`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-01-08 14:38:10 -05:00 committed by GitHub
parent 69dde8e31d
commit b78396505f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 8 deletions

View file

@ -438,7 +438,8 @@ CREATE TABLE IF NOT EXISTS billing_subscriptions (
billing_customer_id INTEGER NOT NULL REFERENCES billing_customers(id),
stripe_subscription_id TEXT NOT NULL,
stripe_subscription_status TEXT NOT NULL,
stripe_cancel_at TIMESTAMP
stripe_cancel_at TIMESTAMP,
stripe_cancellation_reason TEXT
);
CREATE INDEX "ix_billing_subscriptions_on_billing_customer_id" ON billing_subscriptions (billing_customer_id);