Skip to content
Community engagement

tracked_link_actions

What a tracked link brought: a visit (per browser), a sign-up, a plan add or a ticket (per dancer). Each counts once per link. Last touch wins: the link in the visitor's `wd_via` cookie when they act.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
link_iduuid no—
kindtext
visitsignupplan_addticket
no—
dancer_iduuid yes—
visitor_idtext yes—
reftext yes—
created_attimestamp nonow()

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

  • (link_id, kind, dancer_id)unique
    tracked_link_actions_dancer_uidx · where "tracked_link_actions"."dancer_id" IS NOT NULL
  • (link_id, kind, visitor_id)unique
    tracked_link_actions_visitor_uidx · where "tracked_link_actions"."dancer_id" IS NULL AND "tracked_link_actions"."visitor_id" IS NOT NULL
  • (link_id, kind)
    tracked_link_actions_link_idx

Foreign keys

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
  }
  tracked_link_actions {
    uuid id PK
    uuid link_id FK
    uuid dancer_id FK
  }
  tracked_links {
    uuid id PK
    text code UK
    uuid event_id FK
    uuid profile_id FK
    uuid created_by FK
  }
  tracked_links ||--o{ tracked_link_actions : "link_id"
  dancers |o--o{ tracked_link_actions : "dancer_id"
  dancers |o--o{ tracked_links : "created_by"

Defined at server/database/schema.ts:1459 as trackedLinkActions.