Events & plans
event_posts
Content plan (migration 0037): an event's posts, each with its own flyer versions (event_flyers.post_id) and one kept. Kinds: shared/utils/posts.ts.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| event_id | uuid | no | — | |
| kind | text | no | — | |
| subject | text | yes | — | |
| due_on | date | yes | — | |
| format | text poststory | no | "post" | |
| status | text plannedposteddropped | no | "planned" | |
| sort | integer | no | 0 | |
| caption | jsonb | 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)event_posts_event_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).
tRPC procedures
- referral.promoKit
- businessEvents.inbox
- businessFlyers.state
- businessFlyers.make
- businessFlyers.directions
- businessFlyers.again
- businessFlyers.feed
- businessFlyers.fix
- businessFlyers.refresh
- businessFlyers.keep
- businessPosts.list
- businessPosts.writeCaption
- businessPosts.saveCaption
- businessPosts.writeCaptions
- businessPosts.propose
- businessPosts.add
- businessPosts.update
- businessPosts.remove
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
}
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{ event_flyers : "event_id"
event_posts |o--o{ event_flyers : "post_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:1119 as eventPosts.