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:
authorThomas Steur <tsteur@users.noreply.github.com>2019-09-03 07:22:05 +0300
committerdiosmosis <diosmosis@users.noreply.github.com>2019-09-03 07:22:05 +0300
commitbb145dbae3764152e0eeca1d4995a96ee82ef9bf (patch)
tree00cf95816275335a7cf3cf8db74808c8592ead6c
parentea18198684c34d8bbb45e15874707e302273dcd9 (diff)
change mysql column type for new installs for log_action.name and log_conversion.url (#14848)
-rw-r--r--core/Db/Schema/Mysql.php4
-rw-r--r--core/Updates/4.0.0-b1.php47
2 files changed, 49 insertions, 2 deletions
diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php
index 7daefdfd13..3f7ac6e767 100644
--- a/core/Db/Schema/Mysql.php
+++ b/core/Db/Schema/Mysql.php
@@ -154,7 +154,7 @@ class Mysql implements SchemaInterface
'log_action' => "CREATE TABLE {$prefixTables}log_action (
idaction INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- name TEXT,
+ name VARCHAR(65000),
hash INTEGER(10) UNSIGNED NOT NULL,
type TINYINT UNSIGNED NULL,
url_prefix TINYINT(2) NULL,
@@ -209,7 +209,7 @@ class Mysql implements SchemaInterface
buster int unsigned NOT NULL,
idorder varchar(100) default NULL,
items SMALLINT UNSIGNED DEFAULT NULL,
- url text NOT NULL,
+ url VARCHAR(65000) NOT NULL,
PRIMARY KEY (idvisit, idgoal, buster),
UNIQUE KEY unique_idsite_idorder (idsite, idorder),
INDEX index_idsite_datetime ( idsite, server_time )
diff --git a/core/Updates/4.0.0-b1.php b/core/Updates/4.0.0-b1.php
new file mode 100644
index 0000000000..202304274e
--- /dev/null
+++ b/core/Updates/4.0.0-b1.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Piwik - 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.0.0-b1.
+ */
+class Updates_4_0_0_b1 extends PiwikUpdates
+{
+ /**
+ * @var MigrationFactory
+ */
+ private $migration;
+
+ public function __construct(MigrationFactory $factory)
+ {
+ $this->migration = $factory;
+ }
+
+ public function getMigrations(Updater $updater)
+ {
+ $migration1 = $this->migration->db->changeColumnType('log_action', 'name', 'VARCHAR(65000)');
+ $migration2 = $this->migration->db->changeColumnType('log_conversion', 'url', 'VARCHAR(65000) NOT NULL');
+
+ return array(
+ $migration1,
+ $migration2,
+ );
+ }
+
+ public function doUpdate(Updater $updater)
+ {
+ $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
+ }
+}