8 lines · 441 B
-- Account suspension: a disabled account cannot sign in or use any credential, and its repositories are read-only.
-- Reasons: 'payment_dispute' (set by the Stripe dispute webhook) or 'admin'.
ALTER TABLE accounts ADD COLUMN disabled_at INTEGER;
ALTER TABLE accounts ADD COLUMN disabled_reason TEXT;
ALTER TABLE accounts ADD COLUMN disabled_note TEXT;

CREATE INDEX accounts_disabled ON accounts(disabled_at) WHERE disabled_at IS NOT NULL;