SQL

CREATE TABLE event  (
  id               INTEGER PRIMARY KEY AUTOINCREMENT,
  name             TEXT    NOT NULL,
  tagline          TEXT    NOT NULL,
  -- one-line summary shown on cards
    description      TEXT    NOT NULL,
  -- full text for the event page
    -- Each event is held at exactly one venue (many events -> one venue).
    venue_id         INTEGER NOT NULL REFERENCES venue (id),
  event_date       TEXT    NOT NULL,
  -- ISO date: YYYY-MM-DD
    start_time       TEXT    NOT NULL,
  -- 24-hour time: HH:MM
    end_time         TEXT    NOT NULL,
  capacity         INTEGER NOT NULL CHECK (capacity > 0),
  ticket_price_eur REAL    NOT NULL DEFAULT 0      -- 0 means the event is free
                     CHECK (ticket_price_eur >= 0)
)

Columns

Column Data type Allow null Primary key Actions
id INTEGER read-only
name TEXT read-only
tagline TEXT read-only
description TEXT read-only
venue_id INTEGER read-only
event_date TEXT read-only
start_time TEXT read-only
end_time TEXT read-only
capacity INTEGER read-only
ticket_price_eur REAL read-only

Foreign Keys

Column Destination
venue_id venue.id

Indexes

Name Columns Unique SQL Drop?