Actualiser api/database.php
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
Security Scan (Trivy) / Trivy — Docker image scan (push) Has been cancelled
Security Scan (Trivy) / Trivy — Filesystem scan (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
Security Scan (Trivy) / Trivy — Docker image scan (push) Has been cancelled
Security Scan (Trivy) / Trivy — Filesystem scan (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
This commit is contained in:
@@ -489,6 +489,14 @@ if (empty($recipeTagsTables)) {
|
|||||||
sort_order INTEGER DEFAULT 0
|
sort_order INTEGER DEFAULT 0
|
||||||
);
|
);
|
||||||
");
|
");
|
||||||
|
}
|
||||||
|
// Migration: add keywords column to recipe_tags if missing
|
||||||
|
$rtCols = array_column($db->query("PRAGMA table_info(recipe_tags)")->fetchAll(), 'name');
|
||||||
|
if (!in_array('keywords', $rtCols)) {
|
||||||
|
try { $db->exec("ALTER TABLE recipe_tags ADD COLUMN keywords TEXT DEFAULT ''"); }
|
||||||
|
catch (PDOException $e) { if (strpos($e->getMessage(), 'duplicate column') === false) throw $e; }
|
||||||
|
}
|
||||||
|
|
||||||
$db->exec("INSERT INTO recipe_tags (key, label, icon, sort_order) VALUES
|
$db->exec("INSERT INTO recipe_tags (key, label, icon, sort_order) VALUES
|
||||||
('cocktail', 'Cocktail', '🍹', 1),
|
('cocktail', 'Cocktail', '🍹', 1),
|
||||||
('sans_alcool', 'Sans alcool', '🚫', 2),
|
('sans_alcool', 'Sans alcool', '🚫', 2),
|
||||||
|
|||||||
Reference in New Issue
Block a user