Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2022-02-03 00:38:31 +0300
committerGitHub <noreply@github.com>2022-02-03 00:38:31 +0300
commitd4b430cb5c8b64711be10cdb6e5dffef7caacd97 (patch)
treed32af6b735ca4c713ff02178dc20787c84e57e8b
parent19cc16c4c0245bc47a3dd2c61d16843946a24c09 (diff)
Make unique index compatible with database without long key support (#18723)
* Make unique index compatible with database without long key support * Changed plugin_name to VARCHAR(60) and title index limit to 100
-rw-r--r--core/Db/Schema/Mysql.php4
-rw-r--r--core/Updates/4.7.0-b2.php3
-rw-r--r--core/Updates/4.7.1-b1.php57
-rw-r--r--core/Version.php2
4 files changed, 60 insertions, 6 deletions
diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php
index 09b0b48922..830b02b04b 100644
--- a/core/Db/Schema/Mysql.php
+++ b/core/Db/Schema/Mysql.php
@@ -362,14 +362,14 @@ class Mysql implements SchemaInterface
'changes' => "CREATE TABLE `{$prefixTables}changes` (
`idchange` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`created_time` DATETIME NOT NULL,
- `plugin_name` VARCHAR(255) NOT NULL,
+ `plugin_name` VARCHAR(60) NOT NULL,
`version` VARCHAR(20) NOT NULL,
`title` VARCHAR(255) NOT NULL,
`description` TEXT NULL,
`link_name` VARCHAR(255) NULL,
`link` VARCHAR(255) NULL,
PRIMARY KEY(`idchange`),
- UNIQUE KEY unique_plugin_version_title (`plugin_name`, `version`, `title`)
+ UNIQUE KEY unique_plugin_version_title (`plugin_name`, `version`, `title`(100))
) ENGINE=$engine DEFAULT CHARSET=$charset
",
);
diff --git a/core/Updates/4.7.0-b2.php b/core/Updates/4.7.0-b2.php
index 3317067c8d..7d57ee147d 100644
--- a/core/Updates/4.7.0-b2.php
+++ b/core/Updates/4.7.0-b2.php
@@ -56,9 +56,6 @@ class Updates_4_7_0_b2 extends PiwikUpdates
'link' => 'VARCHAR(255) NULL',
), $primaryKey = 'idchange');
-
- $migrations[] = $this->migration->db->addUniqueKey('changes', ['plugin_name', 'version', 'title'], 'unique_plugin_version_title');
-
return $migrations;
}
diff --git a/core/Updates/4.7.1-b1.php b/core/Updates/4.7.1-b1.php
new file mode 100644
index 0000000000..b543b812b0
--- /dev/null
+++ b/core/Updates/4.7.1-b1.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+
+namespace Piwik\Updates;
+
+use Piwik\Updater;
+use Piwik\Updates as PiwikUpdates;
+use Piwik\Updater\Migration;
+use Piwik\Updater\Migration\Factory as MigrationFactory;
+
+/**
+ * Update for version 4.7.1-b1
+ */
+class Updates_4_7_1_b1 extends PiwikUpdates
+{
+ /**
+ * @var MigrationFactory
+ */
+ private $migration;
+
+ public function __construct(MigrationFactory $factory)
+ {
+ $this->migration = $factory;
+ }
+
+ /**
+ * Here you can define one or multiple SQL statements that should be executed during the update.
+ *
+ * @param Updater $updater
+ *
+ * @return Migration[]
+ */
+ public function getMigrations(Updater $updater)
+ {
+ $migrations = [];
+
+ $migrations[] = $this->migration->db->changeColumn('changes', 'plugin_name', 'plugin_name', 'VARCHAR(60) NOT NULL');
+
+ $migrations[] = $this->migration->db->dropIndex('changes', 'unique_plugin_version_title');
+ $migrations[] = $this->migration->db->addUniqueKey('changes', ['plugin_name', 'version', 'title(100)'], 'unique_plugin_version_title');
+
+ return $migrations;
+ }
+
+ public function doUpdate(Updater $updater)
+ {
+ $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
+ }
+
+}
diff --git a/core/Version.php b/core/Version.php
index 9a98054701..d07e7ca1f8 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -20,7 +20,7 @@ final class Version
* The current Matomo version.
* @var string
*/
- const VERSION = '4.7.0-rc1';
+ const VERSION = '4.7.1-b1';
const MAJOR_VERSION = 4;