[FIX] Allow higher hashrate values in statistcs table
This commit is contained in:
parent
f58db4f032
commit
c2b9eeac06
@ -2,7 +2,7 @@
|
||||
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
|
||||
|
||||
define('MPOS_VERSION', '0.0.4');
|
||||
define('DB_VERSION', '0.0.13');
|
||||
define('DB_VERSION', '0.0.14');
|
||||
define('CONFIG_VERSION', '0.0.8');
|
||||
define('HASH_VERSION', 1);
|
||||
|
||||
|
||||
30
upgrade/definitions/0.0.13_to_0.0.14.inc.php
Normal file
30
upgrade/definitions/0.0.13_to_0.0.14.inc.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
function run_0014() {
|
||||
// Ugly but haven't found a better way
|
||||
global $setting, $config, $user, $mysqli;
|
||||
|
||||
// Version information
|
||||
$db_version_old = '0.0.13'; // What version do we expect
|
||||
$db_version_new = '0.0.14'; // What is the new version we wish to upgrade to
|
||||
$db_version_now = $setting->getValue('DB_VERSION'); // Our actual version installed
|
||||
|
||||
// Upgrade specific variables
|
||||
$aSql[] = "ALTER TABLE `statistics_users` CHANGE `hashrate` `hashrate` BIGINT UNSIGNED NOT NULL";
|
||||
$aSql[] = "UPDATE " . $setting->getTableName() . " SET value = '0.0.14' 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user