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

This commit is contained in:
2026-06-25 20:21:34 +00:00
parent 427bcd20a4
commit 3bfa89e61d
+7 -1
View File
@@ -567,6 +567,12 @@ if (!in_array('display_unit_key', $prodColsUnits)) {
try { $db->exec("ALTER TABLE products ADD COLUMN nutriments_json TEXT DEFAULT NULL"); }
catch (PDOException $e) { if (strpos($e->getMessage(), 'duplicate column') === false) throw $e; }
}
// Add tags column to products if missing (bugfix: insert referenced a column never created)
if (!in_array('tags', $prodCols2)) {
try { $db->exec("ALTER TABLE products ADD COLUMN tags TEXT DEFAULT NULL"); }
catch (PDOException $e) { if (strpos($e->getMessage(), 'duplicate column') === false) throw $e; }
}
}
/**
@@ -894,4 +900,4 @@ function getVacuumExpiryDaysPHP(int $baseDays): int {
if ($baseDays <= 30) return (int)round($baseDays * 2.5);
if ($baseDays <= 90) return (int)round($baseDays * 2.5);
return (int)round($baseDays * 1.5);
}
}