From 5921115af068c64d6f0170a30de4e56c060cba0c Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Fri, 12 Jan 2018 01:07:03 +0300 Subject: [PATCH 1/2] Bump version --- src/composer.json | 2 +- src/mibew/libs/common/constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/composer.json b/src/composer.json index e37f0caa..4637b8ba 100644 --- a/src/composer.json +++ b/src/composer.json @@ -1,6 +1,6 @@ { "name": "mibew/mibew", - "version": "3.0.0", + "version": "3.1.0", "description": "Mibew Messenger - open-source live support application", "type": "project", "homepage": "http://mibew.org", diff --git a/src/mibew/libs/common/constants.php b/src/mibew/libs/common/constants.php index 7521b09e..643ee7d6 100644 --- a/src/mibew/libs/common/constants.php +++ b/src/mibew/libs/common/constants.php @@ -20,7 +20,7 @@ /** * Current version of Mibew Messenger */ -define('MIBEW_VERSION', '3.0.0'); +define('MIBEW_VERSION', '3.1.0'); /** * Prefix for session variables. From 0cf963ac5e9dd055d51bb09e62663d7beb84829e Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Fri, 12 Jan 2018 01:07:34 +0300 Subject: [PATCH 2/2] Add primary key to revision database table Fixes #218 --- src/mibew/configs/database_schema.yml | 2 +- .../classes/Mibew/Maintenance/Updater.php | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/mibew/configs/database_schema.yml b/src/mibew/configs/database_schema.yml index 72ea7568..882c67ec 100644 --- a/src/mibew/configs/database_schema.yml +++ b/src/mibew/configs/database_schema.yml @@ -226,7 +226,7 @@ operatorstatistics: revision: fields: - id: "INT NOT NULL" + id: "INT NOT NULL PRIMARY KEY" # Contains relations between operators and groups operatortoopgroup: diff --git a/src/mibew/libs/classes/Mibew/Maintenance/Updater.php b/src/mibew/libs/classes/Mibew/Maintenance/Updater.php index e3548ece..8206b738 100644 --- a/src/mibew/libs/classes/Mibew/Maintenance/Updater.php +++ b/src/mibew/libs/classes/Mibew/Maintenance/Updater.php @@ -439,4 +439,30 @@ class Updater return true; } + + /** + * Performs all database updates needed for 3.1.0. + * + * @return boolean True if the updates have been applied successfully and + * false otherwise. + */ + protected function update30100() + { + $db = $this->getDatabase(); + + if (!$db) { + return false; + } + + try { + // Alter plugin table. + $db->query('ALTER TABLE {revision} ADD PRIMARY KEY (id)'); + } catch (\Exception $e) { + $this->errors[] = getlocal('Cannot update tables: {0}', $e->getMessage()); + + return false; + } + + return true; + } }