CREATE TABLE IF NOT EXISTS portrait (
  portrait_id TEXT PRIMARY KEY NOT NULL,
  sort_number INT NOT NULL,
  title TEXT NOT NULL,
  name TEXT NOT NULL,
  image_id TEXT NOT NULL,
  FOREIGN KEY (image_id) REFERENCES image(image_id)
);

CREATE TABLE IF NOT EXISTS partner (
  partner_id TEXT PRIMARY KEY NOT NULL,
  company_name TEXT NOT NULL,
  logo_image_id TEXT NOT NULL,
  FOREIGN KEY (logo_image_id) REFERENCES image(image_id)
);

CREATE TABLE IF NOT EXISTS partner_details (
  partner_details_id TEXT PRIMARY KEY NOT NULL,
  partner_id TEXT NOT NULL,
  sector TEXT NOT NULL,
  activity TEXT NOT NULL,
  location TEXT NOT NULL,
  website TEXT NOT NULL,
  contact TEXT NOT NULL,
  member_date TEXT NOT NULL,
  right_picture_id TEXT NULL,
  left_picture_id TEXT NULL,
  right_text TEXT NOT NULL,
  FOREIGN KEY (partner_id) REFERENCES partner(partner_id) ON DELETE CASCADE,
  FOREIGN KEY (right_picture_id) REFERENCES image(image_id),
  FOREIGN KEY (left_picture_id) REFERENCES image(image_id)
);

CREATE TABLE IF NOT EXISTS agenda (
  agenda_id TEXT PRIMARY KEY NOT NULL,
  sort_date TEXT NOT NULL,
  date TEXT NOT NULL,
  title TEXT NOT NULL,
  entry TEXT NOT NULL
);

