Skip to content

Commit

Permalink
bump DB version, update db upgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
r4sas committed Apr 25, 2018
1 parent b007bfa commit 832d67f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/version.inc.php
Expand Up @@ -2,7 +2,7 @@
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;

define('MPOS_VERSION', '1.0.9');
define('DB_VERSION', '1.0.2');
define('DB_VERSION', '1.0.3');
define('CONFIG_VERSION', '1.0.1');
define('HASH_VERSION', 1);

Expand Down
10 changes: 3 additions & 7 deletions upgrade/definitions/1.0.2_to_1.0.3.inc.php
Expand Up @@ -9,13 +9,9 @@ function run_103() {
$db_version_now = $setting->getValue('DB_VERSION'); // Our actual version installed

// Upgrade specific variables
$aSql[] = "
ALTER TABLE `statistics_shares`
CHANGE `valid` `valid` BIGINT(20) NOT NULL DEFAULT '0',
CHANGE `invalid` `invalid` BIGINT(20) NOT NULL DEFAULT '0',
CHANGE `pplns_valid` `pplns_valid` BIGINT(20) NOT NULL DEFAULT '0',
CHANGE `pplns_invalid` `pplns_invalid` BIGINT(20) NOT NULL DEFAULT '0';
";
$aSql[] = "UPDATE `statistics_shares` SET `valid` = '0' WHERE `valid` IS NULL;";
$aSql[] = "UPDATE `statistics_shares` SET `pplns_valid` = '0' WHERE `pplns_valid` IS NULL;";
$aSql[] = "ALTER TABLE `statistics_shares` CHANGE `valid` `valid` BIGINT(20) NOT NULL DEFAULT '0', CHANGE `pplns_valid` `pplns_valid` BIGINT(20) NOT NULL DEFAULT '0';";
$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, '<')) {
Expand Down

0 comments on commit 832d67f

Please sign in to comment.