blob: c70169d3ef3bf4721f46300fb184c6fd0e7ab935 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
* @category Piwik
* @package Updates
*/
use Piwik\Core\Piwik_Common;
/**
* @package Updates
*/
class Piwik_Updates_1_9_b9 extends Piwik_Updates
{
static function isMajorUpdate()
{
return true;
}
static function getSql($schema = 'Myisam')
{
$logVisit = Piwik_Common::prefixTable('log_visit');
$logConversion = Piwik_Common::prefixTable('log_conversion');
$addColumns = "DROP `location_continent`,
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`";
return array(
// add geoip columns to log_visit
"ALTER TABLE `$logVisit` $addColumns" => 1091,
// add geoip columns to log_conversion
"ALTER TABLE `$logConversion` $addColumns" => 1091,
);
}
static function update()
{
try {
self::enableMaintenanceMode();
Piwik_Updater::updateDatabase(__FILE__, self::getSql());
self::disableMaintenanceMode();
} catch (Exception $e) {
self::disableMaintenanceMode();
throw $e;
}
}
}
|