diff --git a/api/database.php b/api/database.php index ab76341..8c70c2c 100644 --- a/api/database.php +++ b/api/database.php @@ -461,6 +461,21 @@ if (empty($catTables)) { ('altro', 'Altro', '📦', 16, 1) "); } + +// Recipe library (v2.2) — recettes ajoutées manuellement (cocktails, boissons...), distinctes du planning repas +$recipeLibTables = $db->query("SELECT name FROM sqlite_master WHERE type='table' AND name='recipe_library'")->fetchAll(); +if (empty($recipeLibTables)) { + $db->exec(" + CREATE TABLE recipe_library ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + title TEXT NOT NULL, + recipe_json TEXT NOT NULL, + is_favorite INTEGER DEFAULT 0, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP + ); + "); +} // Internal shopping list table (v1.8.0) — used when SHOPPING_MODE=internal $shopTables = $db->query("SELECT name FROM sqlite_master WHERE type='table' AND name='shopping_list'")->fetchAll();