Skip to main content

People Discovery Model

The people module stores profile interactions separately from friendships.

people_interactions​

ColumnTypeNotes
idUUID PK
user_idUUIDThe actor
target_profile_idUUIDProfile being evaluated
typeenumlike or dislike
expires_attimestamptzSeven days after the latest save
created_at, updated_attimestamptz

There is one row per actor/profile pair. Expired rows are not active for feed, incoming-like, or mutual-like behavior.

people_matches​

ColumnTypeNotes
idUUID PK
user_a_id, user_b_idUUIDCanonically ordered distinct users
profile_a_id, profile_b_idUUIDMatching profile IDs
matched_at, created_attimestamptz

A unique pair constraint prevents duplicate matches. Mutual likes also ensure a unique direct chat, but do not change the friendships table.

people_blocks​

Stores unilateral discovery blocks as (user_id, blocked_user_id). Blocks are unique per pair and remove the other user from discovery/search and interactions.

All three tables have RLS enabled and are accessed through the authenticated API service.