All tables have user_id UUID referencing user_profiles.id
user_profiles.auth0_sub remains as VARCHAR UNIQUE column
admin_users has id UUID PK + user_profile_id UUID FK
No data loss (row counts match before/after)
All FK constraints pass validation
Relates to #206
## Milestone 1: Database migration SQL
Multi-phase SQL migration to convert all user_id columns from VARCHAR(255) storing auth0_sub to UUID referencing user_profiles.id.
### Phases
1. Add `user_profile_id UUID` column to all 18 affected tables
2. Backfill UUID values from `user_profiles` join
3. admin_users: add `id UUID PK`, add `user_profile_id UUID`, backfill, create user_profiles for admins without one
4. Set NOT NULL constraints, add FK constraints with ON DELETE CASCADE, add indexes
5. Drop old VARCHAR columns and FK constraints, rename `user_profile_id` to `user_id`
### Files
- `backend/src/features/user-profile/migrations/005_migrate_user_id_to_uuid.sql` (new)
### Acceptance Criteria
- [ ] Migration executes without error
- [ ] All tables have user_id UUID referencing user_profiles.id
- [ ] user_profiles.auth0_sub remains as VARCHAR UNIQUE column
- [ ] admin_users has id UUID PK + user_profile_id UUID FK
- [ ] No data loss (row counts match before/after)
- [ ] All FK constraints pass validation
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Relates to #206
Milestone 1: Database migration SQL
Multi-phase SQL migration to convert all user_id columns from VARCHAR(255) storing auth0_sub to UUID referencing user_profiles.id.
Phases
user_profile_id UUIDcolumn to all 18 affected tablesuser_profilesjoinid UUID PK, adduser_profile_id UUID, backfill, create user_profiles for admins without oneuser_profile_idtouser_idFiles
backend/src/features/user-profile/migrations/005_migrate_user_id_to_uuid.sql(new)Acceptance Criteria