update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -17,36 +17,39 @@ use Piwik\Updates;
|
|||
*/
|
||||
class Updates_1_9_b9 extends Updates
|
||||
{
|
||||
static function isMajorUpdate()
|
||||
public static function isMajorUpdate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static function getSql()
|
||||
public function getMigrationQueries(Updater $updater)
|
||||
{
|
||||
$logVisit = Common::prefixTable('log_visit');
|
||||
$logConversion = Common::prefixTable('log_conversion');
|
||||
|
||||
$addColumns = "DROP `location_continent`,
|
||||
ADD `location_region` CHAR(2) NULL AFTER `location_country`,
|
||||
$addColumns = "ADD `location_region` CHAR(2) NULL AFTER `location_country`,
|
||||
ADD `location_city` VARCHAR(255) NULL AFTER `location_region`,
|
||||
ADD `location_latitude` FLOAT(10, 6) NULL AFTER `location_city`,
|
||||
ADD `location_longitude` FLOAT(10, 6) NULL AFTER `location_latitude`";
|
||||
$dropColumns = "DROP `location_continent`";
|
||||
|
||||
return array(
|
||||
// add geoip columns to log_visit
|
||||
"ALTER TABLE `$logVisit` $addColumns" => 1091,
|
||||
|
||||
"ALTER TABLE `$logVisit` $dropColumns" => 1091,
|
||||
"ALTER TABLE `$logConversion` $dropColumns" => 1091,
|
||||
|
||||
// add geoip columns to log_visit
|
||||
"ALTER TABLE `$logVisit` $addColumns" => 1060,
|
||||
// add geoip columns to log_conversion
|
||||
"ALTER TABLE `$logConversion` $addColumns" => 1091,
|
||||
"ALTER TABLE `$logConversion` $addColumns" => 1060,
|
||||
);
|
||||
}
|
||||
|
||||
static function update()
|
||||
public function doUpdate(Updater $updater)
|
||||
{
|
||||
try {
|
||||
self::enableMaintenanceMode();
|
||||
Updater::updateDatabase(__FILE__, self::getSql());
|
||||
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
|
||||
self::disableMaintenanceMode();
|
||||
} catch (\Exception $e) {
|
||||
self::disableMaintenanceMode();
|
||||
|
|
@ -54,4 +57,3 @@ class Updates_1_9_b9 extends Updates
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue