www/crontasks.php

changeset 419
99a7f2a6976e
parent 393
5020feba78ec
child 422
7943afc0fcde
--- a/www/crontasks.php	Sat Jun 15 19:41:44 2019 +0200
+++ b/www/crontasks.php	Thu Jun 20 13:55:12 2019 +0200
@@ -15,6 +15,17 @@
 
 
 /*
+ * Upgrade package values.
+ */
+$query = "UPDATE products SET package_volume = bottle_amount + keg_amount WHERE package_volume='0';";
+$result = mysqli_query($connect, $query);
+$changed = mysqli_affected_rows($connect);
+if ($changed > 0) {
+        syslog(LOG_NOTICE, "Updated ".$changed." products to new package_volume value");
+}
+
+
+/*
  * Upgrade inventory_reduced value from old boolean to tiny integer value.
  */
 $query = "UPDATE products SET inventory_reduced=stage WHERE inventory_reduced = 1";

mercurial