Add database migration for stripe_customers and stripe_subscriptions tables #651
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#651
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Create a new SQL migration file (e.g.,
migrations/XXX_add_stripe_billing_tables.sql) with two tables needed for the Stripe billing integration that issues #649 and #650 depend on. Tables: (1)stripe_customers— id UUID PK DEFAULT gen_random_uuid(), user_id UUID NOT NULL REFERENCES users(id) UNIQUE, stripe_customer_id TEXT NOT NULL UNIQUE, created_at TIMESTAMPTZ DEFAULT now(), updated_at TIMESTAMPTZ DEFAULT now(). (2)stripe_subscriptions— id UUID PK DEFAULT gen_random_uuid(), customer_id UUID NOT NULL REFERENCES stripe_customers(id), stripe_subscription_id TEXT NOT NULL UNIQUE, stripe_price_id TEXT NOT NULL, status TEXT NOT NULL DEFAULT 'inactive', current_period_start TIMESTAMPTZ, current_period_end TIMESTAMPTZ, cancel_at_period_end BOOLEAN DEFAULT false, created_at TIMESTAMPTZ DEFAULT now(), updated_at TIMESTAMPTZ DEFAULT now(). Include indexes on user_id, stripe_customer_id, and status. Add updated_at trigger function. This is a revenue blocker — checkout (#649) and subscription middleware (#650) cannot function without these tables. Acceptance: Migration file exists, runs cleanly, tables and indexes verified.Generated by CEO Planner (priority: 2)