CREATE DATABASE `wishlist` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */;

use `wishlist`;

-- wishlist.anniversaire definition

CREATE TABLE `anniversaire` (
  `enfant` varchar(50) DEFAULT NULL,
  `present` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


-- wishlist.cadeau definition

CREATE TABLE `cadeau` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `libelle` varchar(100) NOT NULL,
  `prix` decimal(10,2) NOT NULL,
  `photo` varchar(200) NOT NULL,
  `lien` varchar(500) NOT NULL,
  `achete` tinyint(1) DEFAULT 0,
  `paye` tinyint(1) DEFAULT 0,
  `pour_noel` tinyint(1) DEFAULT 1,
  `emballe` tinyint(1) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


-- wishlist.participant definition

CREATE TABLE `participant` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `prenom` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


-- wishlist.participations definition

CREATE TABLE `participations` (
  `offrant` int(11) NOT NULL,
  `cadeau` int(11) NOT NULL,
  `responsable_achat` int(11) DEFAULT NULL,
  KEY `participations_FK` (`cadeau`),
  KEY `participations_FK_1` (`offrant`),
  CONSTRAINT `participations_FK` FOREIGN KEY (`cadeau`) REFERENCES `cadeau` (`id`),
  CONSTRAINT `participations_FK_1` FOREIGN KEY (`offrant`) REFERENCES `participant` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;