diff --git a/CHANGELOG.md b/CHANGELOG.md index bdf664dd..83308a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,4 @@ -0.0.1 (Mar 7th 2013) +1.0.0 (Jan 18th 2015) -------------------- -* WiP Upload of all files currently available -* Added upstream script collections -* Added SQL structure +* First (non-beta) public release of MPOS diff --git a/include/config/global.inc.dist.php b/include/config/global.inc.dist.php index f35c9bf4..bc8ce5bf 100644 --- a/include/config/global.inc.dist.php +++ b/include/config/global.inc.dist.php @@ -6,7 +6,7 @@ $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1; * Also the URL to check for the most recent upstream versions available * https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-config-version **/ -$config['version'] = '0.0.8'; +$config['version'] = '1.0.0'; $config['version_url'] = 'https://raw.githubusercontent.com/MPOS/php-mpos/master/include/version.inc.php'; /** diff --git a/include/version.inc.php b/include/version.inc.php index 1007908c..9c1b9065 100644 --- a/include/version.inc.php +++ b/include/version.inc.php @@ -1,9 +1,9 @@ getValue('DB_VERSION'); // Our actual version installed + + // Upgrade specific variables + $aSql[] = "ALTER TABLE `blocks` CHANGE `shares` `shares` BIGINT(30) unsigned DEFAULT NULL"; + $aSql[] = "UPDATE " . $setting->getTableName() . " SET value = '1.0.0' 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; + foreach ($aSql as $sql) { + echo '- Preparing: ' . $sql . PHP_EOL; + $stmt = $mysqli->prepare($sql); + if ($stmt && $stmt->execute()) { + echo '- success' . PHP_EOL; + } else { + echo '! failed: ' . $mysqli->error . PHP_EOL; + exit(1); + } + } + } +} +?>