Skip to content

Commit

Permalink
Fix bug sql
Browse files Browse the repository at this point in the history
  • Loading branch information
Dat Pham committed Sep 25, 2018
1 parent 03ce14a commit 7eba53a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lemonway/upgrade/upgrade-1.4.1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 7eba53a

Please sign in to comment.