24 lines
1.0 KiB
Markdown
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
|