Permalink
Browse files

#2539 - Fixed upgrading DB version

  • Loading branch information...
blondak committed Jan 12, 2017
1 parent 893d920 commit 9f32f0119de2b270cb68436f01dc23e671a9b5db
Showing with 4 additions and 3 deletions.
  1. +1 −1 include/version.inc.php
  2. +3 −2 upgrade/definitions/1.0.1_to_1.0.2.inc.php
View
@@ -2,7 +2,7 @@
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
define('MPOS_VERSION', '1.0.6');
define('DB_VERSION', '1.0.1');
define('DB_VERSION', '1.0.2');
define('CONFIG_VERSION', '1.0.1');
define('HASH_VERSION', 1);
@@ -1,7 +1,7 @@
<?php
function run_102() {
// Ugly but haven't found a better way
global $setting, $config, $coin_address, $user, $mysqli, $notification;
global $setting, $config, $coin_address, $user, $mysqli;
// Version information
$db_version_old = '1.0.1'; // What version do we expect
@@ -17,7 +17,8 @@ function run_102() {
PRIMARY KEY (`account_id`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
";
$aSql[] = "UPDATE " . $setting->getTableName() . " SET value = '".$db_version_new."' WHERE name = 'DB_VERSION'";
if ($db_version_now == $db_version_old && version_compare($db_version_now, DB_VERSION, '<')) {
// Run the upgrade
echo '- Starting database migration to version ' . $db_version_new . PHP_EOL;

0 comments on commit 9f32f01

Please sign in to comment.