
/*
By Dario Weinberger & Raphael Payet
©2023
*/

-- Utiliser la base de données
USE rappaurio;

-- Créer la table "User"
CREATE TABLE `users` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
);

-- Créer la table "Search"
CREATE TABLE `search` (
  `id_search` int(11) NOT NULL AUTO_INCREMENT,
  `id` int(11) DEFAULT NULL,
  `article1` varchar(255) NOT NULL,
  `article2` varchar(255) NOT NULL,
  `date` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id_search`),
  KEY `id` (`id`),
  CONSTRAINT `search_ibfk_1` FOREIGN KEY (`id`) REFERENCES `users` (`id`)
);
