Community engagement
giveaway_proposals
A promoter/influencer proposes a giveaway for an event; only admins create giveaways directly, so the event's organizer approves it and it becomes one.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| event_id | uuid | no | — | |
| proposed_by | uuid | yes | — | |
| profile_id | uuid | no | — | |
| prize | text | no | — | |
| description | text | no | "" | |
| sponsor_name | text | yes | — | |
| ends_at | timestamp | yes | — | |
| status | text pendingapproveddeclined | no | "pending" | |
| note | text | yes | — | |
| giveaway_id | uuid | yes | — | |
| decided_by | uuid | yes | — | |
| decided_at | timestamp | yes | — | |
| created_at | timestamp | no | now() |
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
- (event_id, status)giveaway_proposals_event_idx
- (profile_id)giveaway_proposals_profile_idx
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
}
events {
uuid id PK
uuid host_profile_id FK
uuid edited_by FK
}
giveaway_proposals {
uuid id PK
uuid event_id FK
uuid proposed_by FK
uuid profile_id FK
uuid giveaway_id FK
uuid decided_by FK
}
giveaways {
uuid id PK
}
profiles {
uuid id PK
text username UK
}
profiles |o--o{ events : "host_profile_id"
dancers |o--o{ events : "edited_by"
events ||--o{ giveaway_proposals : "event_id"
dancers |o--o{ giveaway_proposals : "proposed_by"
profiles ||--o{ giveaway_proposals : "profile_id"
giveaways |o--o{ giveaway_proposals : "giveaway_id"
dancers |o--o{ giveaway_proposals : "decided_by" Defined at server/database/schema.ts:1496 as giveawayProposals.