feat(profile): add central extended_profiles schema (Phase 0) - #13470
Open
h0lybyte wants to merge 1 commit into
Open
feat(profile): add central extended_profiles schema (Phase 0)#13470h0lybyte wants to merge 1 commit into
h0lybyte wants to merge 1 commit into
Conversation
Proto-first profile consolidation to avoid data duplication across apps. Changes: - Add ExtendedProfile + ProfileLink messages to kbve/profile.proto - Update jobboard.proto to reference kbve.profile.ProfileLink - Add TalentProfile.extended field for central profile JOIN - Regenerate Rust proto (jobboard + kbve modules) - Regenerate TypeScript proto via buf generate - Add ProfileLinkSchema + ExtendedProfileSchema to Zod barrel - Create profile.extended_profiles SQL schema + migration - Add RLS policies (users can CRUD own profile, service-role full access) - Add validation functions (is_valid_profile_links, set_updated_at) SQL Schema: - profile.extended_profiles (user_id PK, bio, location, avatar_url, links, updated_at) - Constraints: bio ≤5000, location ≤120, avatar_url ≤2048, links ≤20 items (HTTPS only) - Kinds: github, linkedin, website, x, itch, artstation, other Migration: 20260628014652_profile_extended_init.sql Next phases (tracked in #13465): - Phase 1: Backfill from jobboard.talent_profiles + meme.meme_user_profiles - Phase 2: Update Axum handlers to JOIN central profile - Phase 3: Drop redundant columns from app tables Issue: #13465 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
25 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proto-first profile consolidation to establish single source of truth for user identity fields (bio, location, avatar, links) before data duplication spreads across apps.
Approach: Define proto contract first → generate Zod/TS/Rust → create SQL matching proto.
Changes
Proto Layer
ExtendedProfile+ProfileLinkmessages tokbve/profile.protojobboard.prototo referencekbve.profile.ProfileLink(remove duplicate)TalentProfile.extendedfield for future JOIN to central profileCode Generation
buf generateProfileLinkSchema+ExtendedProfileSchemato Zod barrelSQL Schema
profile.extended_profilestable (user_id PK, bio, location, avatar_url, links, updated_at)20260628014652_profile_extended_init.sqlis_valid_profile_links(),set_updated_at()Schema Details
Constraints:
RLS Policies:
service_role_full_access: full CRUDuser_read_own: users can SELECT own profileuser_update_own: users can UPDATE own profileuser_insert_own: users can INSERT own profile (one-time)Files Changed
Proto
packages/data/proto/kbve/profile.proto- ExtendedProfile + ProfileLinkpackages/data/proto/jobboard/jobboard.proto- Reference kbve.profile typesGenerated Code
apps/jobboard/src/proto/kbve.profile.rs- NEW (Rust proto)apps/jobboard/src/proto/kbve.common.rs- NEW (Rust proto)apps/jobboard/src/proto/jobboard.rs- Updated (TalentProfile.extended)apps/jobboard/build.rs- Compile kbve proto + add serdeapps/jobboard/src/main.rs- Export kbve proto modulespackages/data/codegen/generated/profile-schema.ts- Add Zod schemasSQL
packages/data/sql/schema/profile/extended_profiles.sql- Schema sourcepackages/data/sql/dbmate/migrations/20260628014652_profile_extended_init.sql- MigrationTesting
Next Steps (Tracked in #13465)
Phase 1: Backfill existing data
jobboard.talent_profiles(bio, location, links)meme.meme_user_profiles(bio, avatar_url)Phase 2: Code migration
profile.extended_profilesPhase 3: Schema cleanup
jobboard.talent_profilesmeme.meme_user_profilesRelated
Closes #13465 (Phase 0 only - schema definition)
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com