Points_for_user
User performance points ledger
| Column Name | Data Type | Constraints |
|---|---|---|
| id | bigint | NOT NULL |
| points | integer | NOT NULL |
| inserted_at | timestamp with time zone | DEFAULT timezone('utc'::text, now()) NOT NULL |
| user_id | uuid | NOT NULL |
| update_reason | text | NOT NULL |
Balance for a user is sum(points) where user_id matches. Each row is a signed delta (positive or negative), not an absolute balance. Rows cascade-delete when the user is deleted.
Security Policies (RLS)
RLS enabled. Herd scope: Not herd-scoped.
| Operation | has_herd_ability ability key | Other paths |
|---|---|---|
| SELECT | — | Row owner (user_id = auth.uid()); platform superadmin |
| INSERT | — | Platform superadmin only |
| UPDATE | — | Platform superadmin only |
| DELETE | — | Platform superadmin only |