CREATE TABLE users
(
  id INT AUTO_INCREMENT NOT NULL,
  username VARCHAR(100) NOT NULL,
  email VARCHAR(100) NOT NULL,
  password VARCHAR(100) NOT NULL,
  PRIMARY KEY (id)
);

CREATE TABLE events
(
  id INT AUTO_INCREMENT NOT NULL,
  date DATE,
  hour INT,
  location VARCHAR(255) NOT NULL,
  description TEXT NOT NULL,
  repertoire TEXT,
  link TEXT,
  user_id INT NOT NULL,
  PRIMARY KEY (id),
  FOREIGN KEY (user_id) REFERENCES users(id)
);

CREATE TABLE photos
(
  id INT AUTO_INCREMENT NOT NULL,
  photographer VARCHAR(255) NOT NULL,
  image_url VARCHAR(255) NOT NULL,
  user_id INT NOT NULL,
  PRIMARY KEY (id),
  FOREIGN KEY (user_id) REFERENCES users(id)
);

CREATE TABLE news
(
  id INT AUTO_INCREMENT NOT NULL,
  title VARCHAR(255) NOT NULL,
  content TEXT NOT NULL,
  image_url VARCHAR(255) NOT NULL,
  user_id INT NOT NULL,
  PRIMARY KEY (id),
  FOREIGN KEY (user_id) REFERENCES users(id)
);

CREATE TABLE subscribers
(
  id INT AUTO_INCREMENT NOT NULL,
  email VARCHAR(100) NOT NULL,
  is_subscribed BOOLEAN NOT NULL,
  user_id INT NOT NULL,
  PRIMARY KEY (id),
  FOREIGN KEY (user_id) REFERENCES users(id)
);