Skip to content

Commit 9f32f01

Browse files
committed
#2539 - Fixed upgrading DB version
1 parent 893d920 commit 9f32f01

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

include/version.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
33

44
define('MPOS_VERSION', '1.0.6');
5-
define('DB_VERSION', '1.0.1');
5+
define('DB_VERSION', '1.0.2');
66
define('CONFIG_VERSION', '1.0.1');
77
define('HASH_VERSION', 1);
88

upgrade/definitions/1.0.1_to_1.0.2.inc.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
function run_102() {
33
// Ugly but haven't found a better way
4-
global $setting, $config, $coin_address, $user, $mysqli, $notification;
4+
global $setting, $config, $coin_address, $user, $mysqli;
55

66
// Version information
77
$db_version_old = '1.0.1'; // What version do we expect
@@ -17,7 +17,8 @@ function run_102() {
1717
PRIMARY KEY (`account_id`,`name`)
1818
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
1919
";
20-
20+
$aSql[] = "UPDATE " . $setting->getTableName() . " SET value = '".$db_version_new."' WHERE name = 'DB_VERSION'";
21+
2122
if ($db_version_now == $db_version_old && version_compare($db_version_now, DB_VERSION, '<')) {
2223
// Run the upgrade
2324
echo '- Starting database migration to version ' . $db_version_new . PHP_EOL;

0 commit comments

Comments
 (0)