diff options
Diffstat (limited to 'core/Updates/4.0.0-b1.php')
-rw-r--r-- | core/Updates/4.0.0-b1.php | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/core/Updates/4.0.0-b1.php b/core/Updates/4.0.0-b1.php index 71b8bc32db..1405911a53 100644 --- a/core/Updates/4.0.0-b1.php +++ b/core/Updates/4.0.0-b1.php @@ -9,6 +9,7 @@ namespace Piwik\Updates; +use Piwik\Config; use Piwik\Updater; use Piwik\Updates as PiwikUpdates; use Piwik\Updater\Migration\Factory as MigrationFactory; @@ -30,16 +31,24 @@ class Updates_4_0_0_b1 extends PiwikUpdates public function getMigrations(Updater $updater) { - $migration1 = $this->migration->db->changeColumnType('log_action', 'name', 'VARCHAR(4096)'); - $migration2 = $this->migration->db->changeColumnType('log_conversion', 'url', 'VARCHAR(4096)'); + $migrations = []; + $migrations[] = $this->migration->db->changeColumnType('log_action', 'name', 'VARCHAR(4096)'); + $migrations[] = $this->migration->db->changeColumnType('log_conversion', 'url', 'VARCHAR(4096)'); - $migration3 = $this->migration->plugin->activate('BulkTracking'); + $customTrackerPluginActive = false; + if (in_array('CustomPiwikJs', Config::getInstance()->Plugins['Plugins'])) { + $customTrackerPluginActive = true; + } - return array( - $migration1, - $migration2, - $migration3 - ); + $migrations[] = $this->migration->plugin->activate('BulkTracking'); + $migrations[] = $this->migration->plugin->deactivate('CustomPiwikJs'); + $migrations[] = $this->migration->plugin->uninstall('CustomPiwikJs'); + + if ($customTrackerPluginActive) { + $migrations[] = $this->migration->plugin->activate('CustomJsTracker'); + } + + return $migrations; } public function doUpdate(Updater $updater) |