diff --git a/src/lemonway/upgrade/upgrade-1.4.1.php b/src/lemonway/upgrade/upgrade-1.4.1.php index cac7bf1..cb84134 100644 --- a/src/lemonway/upgrade/upgrade-1.4.1.php +++ b/src/lemonway/upgrade/upgrade-1.4.1.php @@ -45,11 +45,15 @@ function upgrade_module_1_4_1($module) $os->color = "#4169E1"; $os->save(); - $query = "ALTER TABLE `" . _DB_PREFIX_ . "lemonway_wktoken` - ADD `is_order_validated` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' - ENGINE=" . _MYSQL_ENGINE_ . " DEFAULT CHARSET=utf8;"; + $query = "SELECT `is_order_validated` FROM `" . _DB_PREFIX_ . "lemonway_wktoken`"; + $res = Db::getInstance()->executeS($query); - Db::getInstance()->execute($query); + if (!$res) { + $query = "ALTER TABLE `" . _DB_PREFIX_ . "lemonway_wktoken` + ADD `is_order_validated` tinyint(1) UNSIGNED NOT NULL DEFAULT '0'"; + + Db::getInstance()->execute($query); + } return true; }