mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-28 08:05:45 +00:00
* feat: add operator-granted plans so a workspace can be paid without Stripe, surfaced in the admin panel as a badge, a filter and a card carrying who granted it and why, because the only alternative was writing a fake stripe subscription id into the database * fix: hold a granted plan beside the paid one rather than over it so a Stripe workspace returns to the plan it pays for when the grant ends, route entitlement lookups through EffectivePlanID, separate a repository failure from an unknown plan, end a grant at local end of day, and drop an index that served no query
14 lines
638 B
SQL
14 lines
638 B
SQL
-- Reverses 000149. Every granted plan is forgotten, so a workspace that was
|
|
-- paid only because an operator said so becomes unpaid again on the next
|
|
-- entitlement check. Nothing else is lost: plan_id was never written by a
|
|
-- grant, so a Stripe-backed workspace is already on the plan it pays for.
|
|
ALTER TABLE public.subscriptions
|
|
DROP CONSTRAINT IF EXISTS subscriptions_managed_complete_check;
|
|
|
|
ALTER TABLE public.subscriptions
|
|
DROP COLUMN IF EXISTS managed_at,
|
|
DROP COLUMN IF EXISTS managed_by,
|
|
DROP COLUMN IF EXISTS managed_reason,
|
|
DROP COLUMN IF EXISTS managed_until,
|
|
DROP COLUMN IF EXISTS managed_plan_id;
|