

CREATE TABLE IF NOT EXISTS `mm_menus` (
  `id`               INT AUTO_INCREMENT PRIMARY KEY,
  `restaurateur_id`  INT NOT NULL,
  `date_menu`        DATE NOT NULL,
  `entree`           TEXT,
  `plat`             TEXT NOT NULL,
  `dessert`          TEXT,
  `formule_prix`     DECIMAL(5,2),
  `note`             TEXT,
  `envoye`           TINYINT(1) DEFAULT 0,
  `envoye_le`        DATETIME,
  `cree_le`          DATETIME DEFAULT CURRENT_TIMESTAMP,
  UNIQUE KEY `unique_menu_jour` (`restaurateur_id`, `date_menu`),
  FOREIGN KEY (`restaurateur_id`) REFERENCES `mm_restaurateurs`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
