Uh oh!
There was an error while loading. Please reload this page.
db/identity-code: user_profiles split (epic slice PR6) - #271
Conversation
Rewire the identity domain onto the 0024 schema split. Public-profile fields (name/first_name/last_name/username/avatar_url/bio/location/website/year/ majors/minors/learning_style) now live on a 1:1 user_profiles table; users keeps only identity + auth + activity. One source of truth per field — nothing is written to both users and user_profiles, nor duplicated onto user_settings. - routes/profile.py: _get_user_or_404 reads users (id/email/streak/created_at) and merges user_profiles; new _get_or_create_profile helper (ensure-row + decrypt); username uniqueness + writes go to user_profiles; avatar_url persists to user_profiles; _SETTINGS_COLS drops the moved columns. - routes/auth.py: get_me reads name/username/avatar_url from user_profiles; google_callback writes profile fields to user_profiles (insert/upsert) and keeps only email/auth/activity on users; oauth_tokens.expires_at sent as None (not "") when absent, since it is TIMESTAMPTZ now. - routes/onboarding.py: the profile-field write moves to a user_profiles upsert; onboarding_completed stays on users. Enrollment loop untouched (academics owns it). - models: drop display_name from UpdateProfileBody and the moved fields from SettingsResponse. - tests: profile/onboarding/decrypt-boundary updated for the split; added an ensure-row test and a per-table column-contract pin. Encryption boundary preserved: name/first_name/last_name/bio/location stay 🔒 TEXT (encrypt_if_present at write, decrypt_if_present at read) on user_profiles; users.email stays 🔒 on users. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying with |
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs | frontend-staging | 310c4ac | Commit Preview URL Branch Preview URL | Jun 24 2026, 08:20 AM |
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Identity slice (migration 0024). 1:1
user_profiles; slimusers; onboarding profile-write moved touser_profiles; oauthexpires_attimestamptz. Encryption boundary preserved. Green; ruff clean.Plan:
docs/superpowers/plans/2026-06-24-db-identity-code.md.Integration notes:
models/__init__.py+tests/test_response_decrypt_boundary.py(also edited by db/gradebook-code — small additive conflict).users.name/profile cols still read/written bygraph_service.ensure_user_exists,social.py,quiz.py,learn.py,users_search.py— reconcile before the epic→main cutover.