From aa3680934b4420d8f170a7fa65a42c5fc7739b8b Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Mon, 20 Oct 2025 16:18:49 +0200 Subject: [PATCH] Rename lover to profile --- backend/email/emails/functions/mock.ts | 1 - backend/scripts/import-love-tables.sh | 5 +---- backend/shared/src/profiles/supabase.ts | 10 +++++----- common/src/supabase/schema.ts | 14 +++++--------- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/backend/email/emails/functions/mock.ts b/backend/email/emails/functions/mock.ts index 5560a491..46335960 100644 --- a/backend/email/emails/functions/mock.ts +++ b/backend/email/emails/functions/mock.ts @@ -17,7 +17,6 @@ export const mockUser: User = { id: '0k1suGSJKVUnHbCPEhHNpgZPkUP2', username: 'Sinclair', name: 'Sinclair', - // url: 'https://manifold.love/Sinclair', // isAdmin: true, // isTrustworthy: false, link: { diff --git a/backend/scripts/import-love-tables.sh b/backend/scripts/import-love-tables.sh index d9395e3e..137c6ccb 100755 --- a/backend/scripts/import-love-tables.sh +++ b/backend/scripts/import-love-tables.sh @@ -12,7 +12,7 @@ DB_USER="postgres" PORT="5432" psql -U $DB_USER -d postgres -h $DB_NAME -p $PORT -w \ --f ./love-stars-dump.sql \ +-f ./....sql \ # psql -U $DB_USER -d postgres -h $DB_NAME -p $PORT -w \ @@ -25,8 +25,5 @@ psql -U $DB_USER -d postgres -h $DB_NAME -p $PORT -w \ # -f ../supabase/private_users.sql \ # -f ../supabase/users.sql -# psql -U $DB_USER -d postgres -h $DB_NAME -p $PORT -w \ -# -f './import-love-finalize.sql' - echo "Done" ) \ No newline at end of file diff --git a/backend/shared/src/profiles/supabase.ts b/backend/shared/src/profiles/supabase.ts index befeaa2c..ed04e3ff 100644 --- a/backend/shared/src/profiles/supabase.ts +++ b/backend/shared/src/profiles/supabase.ts @@ -24,14 +24,14 @@ export function convertRow(row: ProfileAndUserRow | undefined): Profile | null { return profile as Profile } -const LOVER_COLS = 'profiles.*, name, username, users.data as user' +const PROFILE_COLS = 'profiles.*, name, username, users.data as user' export const getProfile = async (userId: string) => { const pg = createSupabaseDirectClient() return await pg.oneOrNone( ` select - ${LOVER_COLS} + ${PROFILE_COLS} from profiles join @@ -49,7 +49,7 @@ export const getProfiles = async (userIds: string[]) => { return await pg.map( ` select - ${LOVER_COLS} + ${PROFILE_COLS} from profiles join @@ -67,7 +67,7 @@ export const getGenderCompatibleProfiles = async (profile: ProfileRow) => { const profiles = await pg.map( ` select - ${LOVER_COLS} + ${PROFILE_COLS} from profiles join users on users.id = profiles.user_id @@ -92,7 +92,7 @@ export const getCompatibleProfiles = async ( return await pg.map( ` select - ${LOVER_COLS} + ${PROFILE_COLS} from profiles join users on users.id = profiles.user_id diff --git a/common/src/supabase/schema.ts b/common/src/supabase/schema.ts index db700917..27c5ef97 100644 --- a/common/src/supabase/schema.ts +++ b/common/src/supabase/schema.ts @@ -475,7 +475,7 @@ export type Database = { twitter: string | null university: string | null user_id: string - visibility: Database['public']['Enums']['lover_visibility'] + visibility: Database['public']['Enums']['profile_visibility'] wants_kids_strength: number website: string | null } @@ -523,7 +523,7 @@ export type Database = { twitter?: string | null university?: string | null user_id: string - visibility?: Database['public']['Enums']['lover_visibility'] + visibility?: Database['public']['Enums']['profile_visibility'] wants_kids_strength?: number website?: string | null } @@ -571,7 +571,7 @@ export type Database = { twitter?: string | null university?: string | null user_id?: string - visibility?: Database['public']['Enums']['lover_visibility'] + visibility?: Database['public']['Enums']['profile_visibility'] wants_kids_strength?: number website?: string | null } @@ -831,10 +831,6 @@ export type Database = { Args: Record Returns: Record[] } - get_compatibility_answers_and_lovers: { - Args: { p_question_id: number } - Returns: Record[] - } get_compatibility_answers_and_profiles: { Args: { p_question_id: number } Returns: Record[] @@ -912,7 +908,7 @@ export type Database = { } } Enums: { - lover_visibility: 'public' | 'member' + profile_visibility: 'public' | 'member' } CompositeTypes: { [_ in never]: never @@ -1040,7 +1036,7 @@ export type CompositeTypes< export const Constants = { public: { Enums: { - lover_visibility: ['public', 'member'], + profile_visibility: ['public', 'member'], }, }, } as const