#2539 - Fixed upgrading DB version
This commit is contained in:
parent
893d920327
commit
9f32f0119d
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user