diff -r fcf75e232c5b -r 0ff3ba646492 web/drupal/modules/statistics/statistics.install --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/drupal/modules/statistics/statistics.install Fri Aug 21 16:26:26 2009 +0000 @@ -0,0 +1,121 @@ + TRUE, 'default' => "''")); + break; + } + + return $ret; +} + +/** + * Implementation of hook_uninstall(). + */ +function statistics_uninstall() { + // Remove tables. + drupal_uninstall_schema('statistics'); + + variable_del('statistics_count_content_views'); + variable_del('statistics_enable_access_log'); + variable_del('statistics_flush_accesslog_timer'); + variable_del('statistics_day_timestamp'); + variable_del('statistics_block_top_day_num'); + variable_del('statistics_block_top_all_num'); + variable_del('statistics_block_top_last_num'); +} + +/** + * Implementation of hook_schema(). + */ +function statistics_schema() { + $schema['accesslog'] = array( + 'description' => 'Stores site access information for statistics.', + 'fields' => array( + 'aid' => array( + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique accesslog ID.', + ), + 'sid' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Browser session ID of user that visited page.', + ), + 'title' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + 'description' => 'Title of page visited.', + ), + 'path' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + 'description' => 'Internal path to page visited (relative to Drupal root.)', + ), + 'url' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + 'description' => 'Referrer URI.', + ), + 'hostname' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => FALSE, + 'description' => 'Hostname of user that visited the page.', + ), + 'uid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => FALSE, + 'default' => 0, + 'description' => 'User {users}.uid that visited the page.', + ), + 'timer' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Time in milliseconds that the page took to load.', + ), + 'timestamp' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Timestamp of when the page was visited.', + ), + ), + 'indexes' => array( + 'accesslog_timestamp' => array('timestamp'), + 'uid' => array('uid'), + ), + 'primary key' => array('aid'), + ); + + return $schema; +} +