---
detect_relations: true

CometEvent:
  tableName: comet_events
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
      unsigned: true
    sessiontoken: string(64)
    live_until: timestamp
  indexes:
    index_live_until:
      fields: [live_until]
    index_full:
      fields: [id, sessiontoken, live_until]

CometEventContentitem:
  tableName: comet_event_contents
  columns:
    id:
      type: integer
      unsigned: true
      primary: true
      notnull: true
    name:
      type: string(64)
      primary: true
      notnull: true
    value:
      type: string
    serialized_value: boolean
  relations:
    CometEvent:
      local: id
      alias: Event
      foreignAlias: Contentitems
      onUpdate: cascade
      onDelete: cascade
