CREATE TABLE events (
  id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
  slug VARCHAR(512) NOT NULL UNIQUE,
  title TEXT,
  description TEXT,
  show_sponser BOOLEAN NOT NULL DEFAULT false,
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE event_sessions (
  id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
  starts_at TIMESTAMP,
  ends_at TIMESTAMP,
  pinned_state VARCHAR(255),
  img_url VARCHAR(1024),
  img_width INTEGER,
  img_height INTEGER,
  event_id VARCHAR(64) REFERENCES events(id) ON DELETE CASCADE,
  user_id VARCHAR(64) REFERENCES users(id) ON DELETE SET NULL,
  band_id VARCHAR(64) REFERENCES bands(id) ON DELETE SET NULL,
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);