Skip to content
Profiles & cities

profile_access_log

Who got, lost or changed access to a profile, and who did it (0027) — the facts an admin needs to judge a reclaim dispute.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
profile_iduuid no—
actor_iduuid yes—
subject_iduuid yes—
actiontext
createdrequestedapprovedrejectedrole_changedremovedleft
no—
roletext yes—
notetext 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

None besides the primary key.

Indexes

  • (profile_id, created_at)
    profile_access_log_profile_idx

Foreign keys

  • profile_id → profiles.id
    on delete cascade
  • actor_id → dancers.id
    on delete set null
  • subject_id → 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
  }
  profile_access_log {
    uuid id PK
    uuid profile_id FK
    uuid actor_id FK
    uuid subject_id FK
  }
  profiles {
    uuid id PK
    text username UK
  }
  profiles ||--o{ profile_access_log : "profile_id"
  dancers |o--o{ profile_access_log : "actor_id"
  dancers |o--o{ profile_access_log : "subject_id"

Defined at server/database/schema.ts:463 as profileAccessLog.