Skip to content
Venue booking & governance

election_vote_history

Immutable append-only log of every cast/change (G803). Makes "is my vote still X?" verifiable — a vote is never silently overwritten, each change is a row.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
election_iduuid no—
voter_dancer_iduuid no—
from_candidate_iduuid yes—
to_candidate_iduuid no—
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

  • (election_id, voter_dancer_id)
    election_vote_history_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).

REST & webhooks

  • ANY /mcp
  • ANY /mcp/public

Relations

Rendering diagram…

Diagram source
erDiagram
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  election_vote_history {
    uuid id PK
    uuid election_id FK
    uuid voter_dancer_id FK
  }
  moderator_elections {
    uuid id PK
    uuid profile_id FK
  }
  moderator_elections ||--o{ election_vote_history : "election_id"
  dancers ||--o{ election_vote_history : "voter_dancer_id"

Defined at server/database/schema.ts:643 as electionVoteHistory.