Skip to content
Profiles & cities

network_links

Business "Network" curation (migration 0042, RAZ-408). The network itself is derived from shared events; a row here means a page's team ADDED someone by hand or HID a derived contact. One row per (my page, their page).

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
profile_iduuid no—
other_profile_iduuid no—
statustext
addedhidden
no—
created_byuuid yes—
created_attimestamp yesnow()

Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.

Keys, constraints & indexes

Unique

  • (profile_id, other_profile_id) network_links_pair

Indexes

  • (profile_id)
    network_links_profile_idx

Foreign keys

  • profile_id → profiles.id
    on delete cascade
  • other_profile_id → profiles.id
    on delete cascade
  • created_by → dancers.id
    on delete set null

Used by

Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).

Relations

Rendering diagram…

Diagram source
erDiagram
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  network_links {
    uuid id PK
    uuid profile_id FK
    uuid other_profile_id FK
    uuid created_by FK
  }
  profiles {
    uuid id PK
    text username UK
  }
  profiles ||--o{ network_links : "profile_id"
  profiles ||--o{ network_links : "other_profile_id"
  dancers |o--o{ network_links : "created_by"

Defined at server/database/schema.ts:409 as networkLinks.