Piwik\Updates\Updates_0_2_27::getMigrations PHP Метод

getMigrations() публичный Метод

public getMigrations ( Updater $updater )
$updater Piwik\Updater
    public function getMigrations(Updater $updater)
    {
        $migrations = array($this->migration->db->addColumn('log_visit', 'visit_goal_converted', 'TINYINT( 1 ) NOT NULL', 'visit_total_time'), $this->migration->db->sql('CREATE TABLE `' . Common::prefixTable('goal') . "` (\n                `idsite` int(11) NOT NULL,\n                `idgoal` int(11) NOT NULL,\n                `name` varchar(50) NOT NULL,\n                `match_attribute` varchar(20) NOT NULL,\n                `pattern` varchar(255) NOT NULL,\n                `pattern_type` varchar(10) NOT NULL,\n                `case_sensitive` tinyint(4) NOT NULL,\n                `revenue` float NOT NULL,\n                `deleted` tinyint(4) NOT NULL default '0',\n                PRIMARY KEY  (`idsite`,`idgoal`)\n            )", Updater\Migration\Db::ERROR_CODE_TABLE_EXISTS), $this->migration->db->sql('CREATE TABLE `' . Common::prefixTable('log_conversion') . '` (
                `idvisit` int(10) unsigned NOT NULL,
                `idsite` int(10) unsigned NOT NULL,
                `visitor_idcookie` char(32) NOT NULL,
                `server_time` datetime NOT NULL,
                `visit_server_date` date NOT NULL,
                `idaction` int(11) NOT NULL,
                `idlink_va` int(11) NOT NULL,
                `referer_idvisit` int(10) unsigned default NULL,
                `referer_type` int(10) unsigned default NULL,
                `referer_name` varchar(70) default NULL,
                `referer_keyword` varchar(255) default NULL,
                `visitor_returning` tinyint(1) NOT NULL,
                `location_country` char(3) NOT NULL,
                `location_continent` char(3) NOT NULL,
                `url` text NOT NULL,
                `idgoal` int(10) unsigned NOT NULL,
                `revenue` float default NULL,
                PRIMARY KEY  (`idvisit`,`idgoal`),
                KEY `index_idsite_date` (`idsite`,`visit_server_date`)
            )', Updater\Migration\Db::ERROR_CODE_TABLE_EXISTS));
        $tables = DbHelper::getTablesInstalled();
        foreach ($tables as $tableName) {
            if (preg_match('/archive_/', $tableName) == 1) {
                $columns = array('idsite', 'date1', 'date2', 'name', 'ts_archived');
                $tableNameUnprefixed = Common::unprefixTable($tableName);
                $migrations[] = $this->migration->db->addIndex($tableNameUnprefixed, $columns, 'index_all');
            }
        }
        return $migrations;
    }