From 18621d492aeef2cee15c212fd2b656614932e21c Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 5 Jun 2014 18:52:17 +0200 Subject: [PATCH 1/2] [FIX] shares_archive table --- sql/000_base_structure.sql | 4 ++-- upgrade/definitions/0.0.10_to_0.0.11.inc.php | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sql/000_base_structure.sql b/sql/000_base_structure.sql index 63f572419..8a80ee2eb 100644 --- a/sql/000_base_structure.sql +++ b/sql/000_base_structure.sql @@ -155,8 +155,8 @@ CREATE TABLE IF NOT EXISTS `shares` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `shares_archive` ( - `id` bigint(30) NOT NULL AUTO_INCREMENT, - `share_id` bigint(30) NOT NULL, + `id` bigint(30) unsigned NOT NULL AUTO_INCREMENT, + `share_id` bigint(30) unsigned NOT NULL, `username` varchar(120) NOT NULL, `our_result` enum('Y','N') DEFAULT NULL, `upstream_result` enum('Y','N') DEFAULT NULL, diff --git a/upgrade/definitions/0.0.10_to_0.0.11.inc.php b/upgrade/definitions/0.0.10_to_0.0.11.inc.php index 7f332dac3..42b4c89d1 100644 --- a/upgrade/definitions/0.0.10_to_0.0.11.inc.php +++ b/upgrade/definitions/0.0.10_to_0.0.11.inc.php @@ -9,8 +9,8 @@ function run_0011() { $db_version_now = $setting->getValue('DB_VERSION'); // Our actual version installed // Upgrade specific variables - $aSql[] = "ALTER TABLE `shares_archive` MODIFY `id` bigint(30)"; - $aSql[] = "ALTER TABLE `shares_archive` MODIFY `share_id` bigint(30)"; + $aSql[] = "ALTER TABLE `shares_archive` CHANGE `id` `id` BIGINT(30) unsigned NOT NULL AUTO_INCREMENT"; + $aSql[] = "ALTER TABLE `shares_archive` CHANGE `share_id` `share_id` BIGINT(30) unsigned NOT NULL"; $aSql[] = "UPDATE " . $setting->getTableName() . " SET value = '0.0.11' WHERE name = 'DB_VERSION'"; if ($db_version_now == $db_version_old && version_compare($db_version_now, DB_VERSION, '<')) { @@ -22,10 +22,4 @@ function run_0011() { if ($stmt && $stmt->execute()) { echo '- success' . PHP_EOL; } else { - echo '- failed: ' . $mysqli->error . PHP_EOL; - exit(1); - } - } - } -} -?> + echo '- failed: ' . $mysqli->e \ No newline at end of file From 2839d1864c30eef8ee510c6bb98f1cc57b31ec53 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 5 Jun 2014 19:10:30 +0200 Subject: [PATCH 2/2] [FIX] dunno, but my editor cutted the end of file --- upgrade/definitions/0.0.10_to_0.0.11.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/upgrade/definitions/0.0.10_to_0.0.11.inc.php b/upgrade/definitions/0.0.10_to_0.0.11.inc.php index 42b4c89d1..752b41a47 100644 --- a/upgrade/definitions/0.0.10_to_0.0.11.inc.php +++ b/upgrade/definitions/0.0.10_to_0.0.11.inc.php @@ -22,4 +22,10 @@ function run_0011() { if ($stmt && $stmt->execute()) { echo '- success' . PHP_EOL; } else { - echo '- failed: ' . $mysqli->e \ No newline at end of file + echo '- failed: ' . $mysqli->error . PHP_EOL; + exit(1); + } + } + } +} +?> \ No newline at end of file