Events & plans
event_flyers
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| event_id | uuid | no | — | |
| post_id | uuid | yes | — | |
| batch_id | uuid | no | — | |
| look_id | uuid | yes | — | |
| look | jsonb | no | — | |
| mode | text | no | "paint" | |
| base_flyer_id | uuid | yes | — | |
| status | text | no | "painting" | |
| url | text | yes | — | |
| width | integer | yes | — | |
| height | integer | yes | — | |
| lines | jsonb | no | [] | |
| pictured | jsonb | no | [] | |
| notes | text | yes | — | |
| prompt | text | yes | — | |
| model | text | yes | — | |
| check | jsonb | yes | — | |
| error | text | yes | — | |
| kept_at | timestamp | yes | — | |
| created_by | uuid | yes | — | |
| created_at | timestamp | yes | now() | |
| updated_at | timestamp | yes | 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, created_at)event_flyers_event_idx
- (batch_id)event_flyers_batch_idx
Foreign keys
- event_id → events.id on delete cascade
- post_id → event_posts.id on delete cascade
- look_id → brand_looks.id on delete set null
- created_by → dancers.id on delete set null
Referenced by
- ai_usage (flyer_id)
Used by
Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).
tRPC procedures
REST & webhooks
- ANY /mcp
- ANY /mcp/public
Relations
Rendering diagram…
Diagram source
erDiagram
ai_usage {
uuid id PK
uuid event_id FK
uuid flyer_id FK
uuid dancer_id FK
}
brand_looks {
uuid id PK
uuid profile_id FK
uuid created_by FK
}
dancers {
uuid id PK
text email UK
text neon_auth_id UK
text username UK
}
event_flyers {
uuid id PK
uuid event_id FK
uuid post_id FK
uuid look_id FK
uuid created_by FK
}
event_posts {
uuid id PK
uuid event_id FK
uuid created_by FK
}
events {
uuid id PK
uuid host_profile_id FK
uuid edited_by FK
}
events |o--o{ ai_usage : "event_id"
event_flyers |o--o{ ai_usage : "flyer_id"
dancers |o--o{ ai_usage : "dancer_id"
dancers |o--o{ brand_looks : "created_by"
events ||--o{ event_flyers : "event_id"
event_posts |o--o{ event_flyers : "post_id"
brand_looks |o--o{ event_flyers : "look_id"
dancers |o--o{ event_flyers : "created_by"
events ||--o{ event_posts : "event_id"
dancers |o--o{ event_posts : "created_by"
dancers |o--o{ events : "edited_by" Defined at server/database/schema.ts:1137 as eventFlyers.