diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2016-04-19 00:06:33 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2016-04-19 00:06:33 +0300 |
commit | 24d8a0ee74fd6d6f26338c3efb8eb143eaed5ec0 (patch) | |
tree | e303601210c2b9d1e8b776007b8808d41f04adc7 /plugins | |
parent | 252148a742fa0681066d16a2aba30d429ef45e25 (diff) |
fix DB field piwik_log_visit.location_provider too small (#10003)
* fixes #9564 fix DB field piwik_log_visit.location_provider too small
* use new plugins updater API
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Provider/Provider.php | 2 | ||||
-rw-r--r-- | plugins/Provider/Updates/3.0.0-b1.php | 43 |
2 files changed, 44 insertions, 1 deletions
diff --git a/plugins/Provider/Provider.php b/plugins/Provider/Provider.php index 1fb5385651..4aed41100c 100644 --- a/plugins/Provider/Provider.php +++ b/plugins/Provider/Provider.php @@ -30,7 +30,7 @@ class Provider extends \Piwik\Plugin public function install() { // add column hostname / hostname ext in the visit table - $query = "ALTER TABLE `" . Common::prefixTable('log_visit') . "` ADD `location_provider` VARCHAR( 100 ) NULL"; + $query = "ALTER TABLE `" . Common::prefixTable('log_visit') . "` ADD `location_provider` VARCHAR(200) NULL"; // if the column already exist do not throw error. Could be installed twice... try { diff --git a/plugins/Provider/Updates/3.0.0-b1.php b/plugins/Provider/Updates/3.0.0-b1.php new file mode 100644 index 0000000000..27cae67555 --- /dev/null +++ b/plugins/Provider/Updates/3.0.0-b1.php @@ -0,0 +1,43 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ + +namespace Piwik\Plugins\Provider\Updates; + +use Piwik\Updater; +use Piwik\Updates as PiwikUpdates; +use Piwik\Updater\Migration; +use Piwik\Updater\Migration\Factory as MigrationFactory; + +/** + * Update for version 3.0.0-b1. + */ +class Updates_3_0_0_b1 extends PiwikUpdates +{ + /** + * @var MigrationFactory + */ + private $migration; + + public function __construct(MigrationFactory $factory) + { + $this->migration = $factory; + } + + public function getMigrations(Updater $updater) + { + return array( + $this->migration->db->changeColumnType('log_visit', 'location_provider', 'VARCHAR(200) NULL') + ); + } + + public function doUpdate(Updater $updater) + { + $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); + } +} |