Files
nuzlocke-tracker/.beans/nuzlocke-tracker-bnhh--user-model-run-ownership-and-visibility-migration.md
Julian Tabel c9d42b091f
All checks were successful
CI / backend-tests (push) Successful in 26s
CI / frontend-tests (push) Successful in 29s
Daedalus and Talos integration test
2026-03-20 16:31:19 +01:00

24 lines
1.0 KiB
Markdown

---
# nuzlocke-tracker-bnhh
title: User model, run ownership, and visibility migration
status: todo
type: task
priority: normal
created_at: 2026-03-20T15:28:18Z
updated_at: 2026-03-20T15:28:34Z
parent: nuzlocke-tracker-d98o
blocked_by:
- nuzlocke-tracker-2561
---
Create a User model synced from Supabase Auth. Add owner_id FK to runs table. Add visibility column (public/private) to runs with default public. Existing runs will have NULL owner_id (unowned).
## Checklist
- [ ] Create User model (id matches Supabase user UUID, email, display_name, created_at)
- [ ] Alembic migration: create users table
- [ ] Alembic migration: add owner_id (nullable FK to users) and visibility (enum: public/private, default public) to runs table
- [ ] Update Run model with owner relationship and visibility field
- [ ] Create user sync endpoint or webhook (on first login, upsert user record from Supabase JWT claims)
- [ ] Update RunResponse schema to include owner and visibility
- [ ] Add visibility enforcement: private runs return 403 unless requester is owner