collab: Limit customers to one free trial (#29232)

This PR makes it so customers can only subscribe to the trial once.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-04-22 16:41:17 -04:00 committed by GitHub
parent abf2b9d7d3
commit a0eaede13d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 36 additions and 3 deletions

View file

@ -492,7 +492,8 @@ CREATE TABLE IF NOT EXISTS billing_customers (
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id INTEGER NOT NULL REFERENCES users (id),
has_overdue_invoices BOOLEAN NOT NULL DEFAULT FALSE,
stripe_customer_id TEXT NOT NULL
stripe_customer_id TEXT NOT NULL,
trial_started_at TIMESTAMP
);
CREATE UNIQUE INDEX "uix_billing_customers_on_user_id" ON billing_customers (user_id);