Skip to content
Venue booking & governance

election_candidates

A self-nominated candidate + the guidelines they run on (G802). One candidacy per dancer per election; a real (verified) profile is required — enforced in the router by requiring the dancer to have a username.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
election_iduuid no—
dancer_iduuid no—
guidelinestext no—
statementtext 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

  • (election_id, dancer_id) election_candidates_unique

Indexes

No secondary indexes.

Foreign keys

Referenced by

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
  }
  election_candidates {
    uuid id PK
    uuid election_id FK
    uuid dancer_id FK
  }
  election_votes {
    uuid id PK
    uuid election_id FK
    uuid voter_dancer_id FK
    uuid candidate_id FK
  }
  moderator_elections {
    uuid id PK
    uuid profile_id FK
  }
  moderator_elections ||--o{ election_candidates : "election_id"
  dancers ||--o{ election_candidates : "dancer_id"
  moderator_elections ||--o{ election_votes : "election_id"
  dancers ||--o{ election_votes : "voter_dancer_id"
  election_candidates ||--o{ election_votes : "candidate_id"

Defined at server/database/schema.ts:616 as electionCandidates.