Skip to content
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

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
event_iduuid no—
kindtext no—
subjecttext yes—
due_ondate yes—
formattext
poststory
no"post"
statustext
plannedposteddropped
no"planned"
sortinteger no0
captionjsonb yes—
created_byuuid yes—
created_attimestamp yesnow()
updated_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

  • (event_id)
    event_posts_event_idx

Foreign keys

  • event_id → events.id
    on delete cascade
  • created_by → dancers.id
    on delete set null

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
  }
  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.