Rename lover to profile

This commit is contained in:
MartinBraquet
2025-10-20 16:18:49 +02:00
parent 0b36586ddf
commit aa3680934b
4 changed files with 11 additions and 19 deletions

View File

@@ -17,7 +17,6 @@ export const mockUser: User = {
id: '0k1suGSJKVUnHbCPEhHNpgZPkUP2',
username: 'Sinclair',
name: 'Sinclair',
// url: 'https://manifold.love/Sinclair',
// isAdmin: true,
// isTrustworthy: false,
link: {

View File

@@ -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"
)

View File

@@ -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

View File

@@ -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<PropertyKey, never>
Returns: Record<string, unknown>[]
}
get_compatibility_answers_and_lovers: {
Args: { p_question_id: number }
Returns: Record<string, unknown>[]
}
get_compatibility_answers_and_profiles: {
Args: { p_question_id: number }
Returns: Record<string, unknown>[]
@@ -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