Commit b99fde67 authored by Richard Mansfield's avatar Richard Mansfield

Add site_data table for counts of views/users/groups over time

Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent c48f7edf
......@@ -793,5 +793,15 @@
<KEY NAME="hostfk" TYPE="foreign" FIELDS="host" REFTABLE="host" REFFIELDS="wwwroot" />
</KEYS>
</TABLE>
<TABLE NAME="site_data">
<FIELDS>
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="value" TYPE="text" LENGTH="small"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="ctime,type" />
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
......@@ -1320,6 +1320,22 @@ function xmldb_core_upgrade($oldversion=0) {
add_field($table, $field);
}
// @TODO: Stats upgrade:
// Need table for weekly stats: counts of users, groups, views, view visits
// Daily data: count of logged-in users
// Add ctime to usr table for count of users created
// Add site start time to config table; initialise with earliest ctime from view, artefact, site_content?
// Add visits column to view table, updated daily from log on filesystem
// Records in cron table
if ($oldversion < 2009122200) {
$table = new XMLDBTable('site_data');
$table->addFieldInfo('ctime', XMLDB_TYPE_DATETIME, null, XMLDB_NOTNULL);
$table->addFieldInfo('type', XMLDB_TYPE_CHAR, 255, null, XMLDB_NOTNULL);
$table->addFieldInfo('value', XMLDB_TYPE_TEXT, 'small', null);
$table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('ctime','type'));
create_table($table);
}
return $status;
}
......
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2009120900;
$config->version = 2009122200;
$config->release = '1.3.0dev';
$config->minupgradefrom = 2008040200;
$config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment