00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 $installer = $this;
00028
00029
00030 $installer->startSetup();
00031
00032 $installer->run("
00033
00034 -- DROP TABLE IF EXISTS {$this->getTable('log_customer')};
00035 CREATE TABLE {$this->getTable('log_customer')} (
00036 `log_id` int(10) unsigned NOT NULL auto_increment,
00037 `visitor_id` bigint(20) unsigned default NULL,
00038 `customer_id` int(11) NOT NULL default '0',
00039 `login_at` datetime NOT NULL default '0000-00-00 00:00:00',
00040 `logout_at` datetime default NULL,
00041 PRIMARY KEY (`log_id`)
00042 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Customers log information';
00043
00044 -- DROP TABLE IF EXISTS {$this->getTable('log_quote')};
00045 CREATE TABLE {$this->getTable('log_quote')} (
00046 `quote_id` int(10) unsigned NOT NULL default '0',
00047 `visitor_id` bigint(20) unsigned default NULL,
00048 `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
00049 `deleted_at` datetime default NULL,
00050 PRIMARY KEY (`quote_id`)
00051 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Quote log data';
00052
00053 -- DROP TABLE IF EXISTS {$this->getTable('log_summary')};
00054 CREATE TABLE {$this->getTable('log_summary')} (
00055 `summary_id` bigint(20) unsigned NOT NULL auto_increment,
00056 `type_id` smallint(5) unsigned default NULL,
00057 `visitor_count` int(11) NOT NULL default '0',
00058 `customer_count` int(11) NOT NULL default '0',
00059 `add_date` datetime NOT NULL default '0000-00-00 00:00:00',
00060 PRIMARY KEY (`summary_id`)
00061 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Summary log information';
00062
00063 -- DROP TABLE IF EXISTS {$this->getTable('log_summary_type')};
00064 CREATE TABLE {$this->getTable('log_summary_type')} (
00065 `type_id` smallint(5) unsigned NOT NULL auto_increment,
00066 `type_code` varchar(64) NOT NULL default '',
00067 `period` smallint(5) unsigned NOT NULL default '0',
00068 `period_type` enum('MINUTE','HOUR','DAY','WEEK','MONTH') NOT NULL default 'MINUTE',
00069 PRIMARY KEY (`type_id`)
00070 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Type of summary information';
00071
00072 insert into {$this->getTable('log_summary_type')} (`type_id`,`type_code`,`period`,`period_type`) values
00073 (1,'hour',1,'HOUR'),(2,'day',1,'DAY')
00074 /* ,(3,'week',1,'WEEK'),(4,'month',1,'MONTH') */;
00075
00076 -- DROP TABLE IF EXISTS {$this->getTable('log_url')};
00077 CREATE TABLE {$this->getTable('log_url')} (
00078 `url_id` bigint(20) unsigned NOT NULL default '0',
00079 `visitor_id` bigint(20) unsigned default NULL,
00080 `visit_time` datetime NOT NULL default '0000-00-00 00:00:00'
00081 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='URL visiting history';
00082
00083 -- DROP TABLE IF EXISTS {$this->getTable('log_url_info')};
00084 CREATE TABLE {$this->getTable('log_url_info')} (
00085 `url_id` bigint(20) unsigned NOT NULL auto_increment,
00086 `url` varchar(255) NOT NULL default '',
00087 `referer` varchar(255) default NULL,
00088 PRIMARY KEY (`url_id`)
00089 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Detale information about url visit';
00090
00091 -- DROP TABLE IF EXISTS {$this->getTable('log_visitor')};
00092 CREATE TABLE {$this->getTable('log_visitor')} (
00093 `visitor_id` bigint(20) unsigned NOT NULL auto_increment,
00094 `session_id` char(64) NOT NULL default '',
00095 `first_visit_at` datetime default NULL,
00096 `last_visit_at` datetime NOT NULL default '0000-00-00 00:00:00',
00097 `last_url_id` bigint(20) unsigned NOT NULL default '0',
00098 PRIMARY KEY (`visitor_id`)
00099 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='System visitors log';
00100
00101 -- DROP TABLE IF EXISTS {$this->getTable('log_visitor_info')};
00102 CREATE TABLE {$this->getTable('log_visitor_info')} (
00103 `visitor_id` bigint(20) unsigned NOT NULL default '0',
00104 `http_referer` varchar(255) default NULL,
00105 `http_user_agent` varchar(255) default NULL,
00106 `http_accept_charset` varchar(255) default NULL,
00107 `http_accept_language` varchar(255) default NULL,
00108 `server_addr` bigint(20) default NULL,
00109 `remote_addr` bigint(20) default NULL,
00110 PRIMARY KEY (`visitor_id`)
00111 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Additional information by visitor';
00112
00113 ");
00114
00115 $installer->endSetup();