[FIX] Properly run the upgrade

This commit is contained in:
Sebastian Grewe 2015-01-18 16:04:32 +01:00
parent 4bf899bb84
commit da08b6a217
2 changed files with 5 additions and 4 deletions

View File

@ -1,9 +1,9 @@
<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
define('MPOS_VERSION', '0.0.4');
define('DB_VERSION', '0.0.15');
define('CONFIG_VERSION', '0.0.8');
define('MPOS_VERSION', '1.0.0');
define('DB_VERSION', '1.0.0');
define('CONFIG_VERSION', '1.0.0');
define('HASH_VERSION', 1);
// Fetch installed database version

View File

@ -9,7 +9,8 @@ function run_100() {
$db_version_now = $setting->getValue('DB_VERSION'); // Our actual version installed
// Upgrade specific variables
$aSql[] = "ALTER TABLE `blocks` CHANGE `shares` `shares` BIGINT(30) unsigned NOT NULL AUTO_INCREMENT";
$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