summaryrefslogtreecommitdiff
path: root/modules/statistics/statistics.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-04-24 08:23:02 +0000
committerDries Buytaert <dries@buytaert.net>2009-04-24 08:23:02 +0000
commit6e334892f2df1f744bdc305570b82f79b2a6cfd2 (patch)
treebd28ef6048e5b046775cd09275dd8af230d649ac /modules/statistics/statistics.install
parente99838fbf488d9bca18f56e7ea6aee32d563ab68 (diff)
downloadbrdo-6e334892f2df1f744bdc305570b82f79b2a6cfd2.tar.gz
brdo-6e334892f2df1f744bdc305570b82f79b2a6cfd2.tar.bz2
- Patch #440768 by Dave Reid: move {node_counter} table from node module to statistics module.
Diffstat (limited to 'modules/statistics/statistics.install')
-rw-r--r--modules/statistics/statistics.install66
1 files changed, 47 insertions, 19 deletions
diff --git a/modules/statistics/statistics.install b/modules/statistics/statistics.install
index e835cf317..4b3141d80 100644
--- a/modules/statistics/statistics.install
+++ b/modules/statistics/statistics.install
@@ -10,31 +10,13 @@ function statistics_install() {
}
/**
- * Changes session ID field to VARCHAR(64) to add support for SHA-1 hashes.
- */
-function statistics_update_1000() {
- $ret = array();
-
- switch ($GLOBALS['db_type']) {
- case 'mysql':
- case 'mysqli':
- $ret[] = update_sql("ALTER TABLE {accesslog} CHANGE COLUMN sid sid varchar(64) NOT NULL default ''");
- break;
- case 'pgsql':
- db_change_column($ret, 'accesslog', 'sid', 'sid', 'varchar(64)', array('not null' => TRUE, 'default' => "''"));
- break;
- }
-
- return $ret;
-}
-
-/**
* Implementation of hook_uninstall().
*/
function statistics_uninstall() {
// Remove tables.
drupal_uninstall_schema('statistics');
+ // Remove variables.
variable_del('statistics_count_content_views');
variable_del('statistics_enable_access_log');
variable_del('statistics_flush_accesslog_timer');
@@ -115,10 +97,51 @@ function statistics_schema() {
'primary key' => array('aid'),
);
+ $schema['node_counter'] = array(
+ 'description' => 'Access statistics for {node}s.',
+ 'fields' => array(
+ 'nid' => array(
+ 'description' => 'The {node}.nid for these statistics.',
+ 'type' => 'int',
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ 'totalcount' => array(
+ 'description' => 'The total number of times the {node} has been viewed.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ 'size' => 'big',
+ ),
+ 'daycount' => array(
+ 'description' => 'The total number of times the {node} has been viewed today.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ 'size' => 'medium',
+ ),
+ 'timestamp' => array(
+ 'description' => 'The most recent time the {node} has been viewed.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ ),
+ 'primary key' => array('nid'),
+ );
+
return $schema;
}
/**
+ * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x
+ * @{
+ */
+
+/**
* Allow longer referrers.
*/
function statistics_update_7000() {
@@ -126,3 +149,8 @@ function statistics_update_7000() {
db_change_field($ret, 'accesslog', 'url', 'url', array('type' => 'text', 'not null' => FALSE));
return $ret;
}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */