Files
sorsfonalak/crates/db/migrations/0004_tier_roles.sql
T
fecoandClaude Opus 5.5 4aabb7343c Model tiers: per-model credits and premium/vip roles
LLM_MODELS entries are now model[=credits][@role]. The default tiers follow
the model comparison rated by an astrologer: Claude Haiku 5.5 (free, 1
credit), GPT-5.6 Terra (premium, 3 credits), Claude Opus 5.5 (vip, 10 credits).
VIP includes premium, admins may use every model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-15 20:46:30 +00:00

6 lines
331 B
SQL

-- Subscription tiers as roles: 'premium' and 'vip' unlock the models marked
-- for them in the backend's LLM_MODELS.
ALTER TABLE users DROP CONSTRAINT users_roles_valid;
ALTER TABLE users ADD CONSTRAINT users_roles_valid
CHECK (cardinality(roles) > 0 AND roles <@ ARRAY['admin', 'creator', 'premium', 'vip', 'user']::text[]);