2
// $Id: statistics.install,v 1.13 2007/12/18 12:59:22 dries Exp $
5
* Implementation of hook_install().
7
function statistics_install() {
9
drupal_install_schema('statistics');
13
* Changes session ID field to VARCHAR(64) to add support for SHA-1 hashes.
15
function statistics_update_1000() {
18
switch ($GLOBALS['db_type']) {
21
$ret[] = update_sql("ALTER TABLE {accesslog} CHANGE COLUMN sid sid varchar(64) NOT NULL default ''");
24
db_change_column($ret, 'accesslog', 'sid', 'sid', 'varchar(64)', array('not null' => TRUE, 'default' => "''"));
32
* Implementation of hook_uninstall().
34
function statistics_uninstall() {
36
drupal_uninstall_schema('statistics');
38
variable_del('statistics_count_content_views');
39
variable_del('statistics_enable_access_log');
40
variable_del('statistics_flush_accesslog_timer');
41
variable_del('statistics_day_timestamp');
42
variable_del('statistics_block_top_day_num');
43
variable_del('statistics_block_top_all_num');
44
variable_del('statistics_block_top_last_num');
48
* Implementation of hook_schema().
50
function statistics_schema() {
51
$schema['accesslog'] = array(
52
'description' => t('Stores site access information for statistics.'),
57
'description' => t('Primary Key: Unique accesslog ID.'),
64
'description' => t('Browser session ID of user that visited page.'),
70
'description' => t('Title of page visited.'),
76
'description' => t('Internal path to page visited (relative to Drupal root.)'),
82
'description' => t('Referrer URI.'),
88
'description' => t('Hostname of user that visited the page.'),
95
'description' => t('User {users}.uid that visited the page.'),
102
'description' => t('Time in milliseconds that the page took to load.'),
104
'timestamp' => array(
109
'description' => t('Timestamp of when the page was visited.'),
113
'accesslog_timestamp' => array('timestamp'),
114
'uid' => array('uid'),
116
'primary key' => array('aid'),