Database
Schema overview
Tables
users
Beheerd door Supabase Auth, plus een profiles table voor app-specifieke data.
| Column | Type | Notes |
|---|---|---|
| id | uuid | PK, FK naar auth.users |
| full_name | text | |
| created_at | timestamptz |
orders
| Column | Type | Notes |
|---|---|---|
| id | uuid | PK |
| user_id | uuid | FK naar users |
| status | text | enum: pending/paid/cancelled |
| total | numeric |
Row Level Security (RLS)
Belangrijke RLS policies die je moet weten:
ordersis alleen zichtbaar voor de eigenaar (user_id = auth.uid())- Admin role kan alles zien (gecontroleerd via
is_adminclaim in JWT)
Migraties
Migraties leven in github.com/.../supabase/migrations.
Backups
Supabase doet automatisch dagelijkse backups (7 dagen retentie op pro plan). Voor langere retentie zie de backup procedure in deploy.