CREATE DATABASE `mia`;

USE `mia`;

-- mia.participation definition

CREATE TABLE `participation` (
  `user` uuid DEFAULT NULL,
  `session` uuid DEFAULT NULL,
  `role_during_session` varchar(100) DEFAULT 'A'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


-- mia.`session` definition

CREATE TABLE `session` (
  `id` uuid NOT NULL,
  `scheduled_on` datetime DEFAULT NULL,
  `topic` varchar(100) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `nb_of_attended` int(11) DEFAULT NULL,
  `nb_of_participants` int(11) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


-- mia.`user` definition

CREATE TABLE `user` (
  `id` uuid NOT NULL,
  `name` varchar(30) DEFAULT NULL,
  `firstname` varchar(50) DEFAULT NULL,
  `nickname` varchar(100) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `gender` varchar(1) DEFAULT NULL,
  `email` varchar(200) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `session` uuid DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;