Skip to content
Browse files

fixing up the stats table enums

  • Loading branch information...
1 parent d4b86c9 commit 1282edc82641fbeda188b9b993268fdfc1e339d8 mjollnir_ committed Sep 22, 2006
Showing with 7 additions and 7 deletions.
  1. +3 −3 lib/db/mysql.sql
  2. +3 −3 lib/db/postgres7.sql
  3. +1 −1 lib/statslib.php
View
6 lib/db/mysql.sql
@@ -750,7 +750,7 @@ CREATE TABLE `prefix_stats_daily` (
`courseid` int(10) unsigned NOT NULL default 0,
`roleid` int(10) unsigned NOT NULL default 0,
`timeend` int(10) unsigned NOT NULL default 0,
- `stattype` enum('enrolments', 'activity', 'logins') NOT NULL default 'logins',
+ `stattype` enum('enrolments', 'activity', 'logins') NOT NULL default 'activity',
`stat1` int(10) unsigned NOT NULL default 0,
`stat2` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
@@ -763,7 +763,7 @@ CREATE TABLE prefix_stats_weekly (
`courseid` int(10) unsigned NOT NULL default 0,
`roleid` int(10) unsigned NOT NULL default 0,
`timeend` int(10) unsigned NOT NULL default 0,
- `stattype` enum('enrolments', 'activity', 'logins') NOT NULL default 'logins',
+ `stattype` enum('enrolments', 'activity', 'logins') NOT NULL default 'activity',
`stat1` int(10) unsigned NOT NULL default 0,
`stat2` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
@@ -776,7 +776,7 @@ CREATE TABLE prefix_stats_monthly (
`courseid` int(10) unsigned NOT NULL default 0,
`roleid` int(10) unsigned NOT NULL default 0,
`timeend` int(10) unsigned NOT NULL default 0,
- `stattype` enum('enrolments', 'activity', 'logins') NOT NULL default 'logins',
+ `stattype` enum('enrolments', 'activity', 'logins') NOT NULL default 'activity',
`stat1` int(10) unsigned NOT NULL default 0,
`stat2` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
View
6 lib/db/postgres7.sql
@@ -532,7 +532,7 @@ CREATE TABLE prefix_stats_daily (
courseid INTEGER NOT NULL default 0,
roleid INTEGER NOT NULL default 0,
timeend INTEGER NOT NULL default 0,
- stattype varchar(20) NOT NULL default 'logins',
+ stattype varchar(20) NOT NULL default 'activity',
stat1 INTEGER NOT NULL default 0,
stat2 INTEGER NOT NULL default 0,
CHECK (stattype::text = 'enrolments' OR stattype::text = 'activity' OR stattype::text = 'logins')
@@ -546,7 +546,7 @@ CREATE TABLE prefix_stats_weekly (
courseid INTEGER NOT NULL default 0,
roleid INTEGER NOT NULL default 0,
timeend INTEGER NOT NULL default 0,
- stattype varchar(20) NOT NULL default '',
+ stattype varchar(20) NOT NULL default 'activity',
stat1 INTEGER NOT NULL default 0,
stat2 INTEGER NOT NULL default 0,
CHECK (stattype::text = 'enrolments' OR stattype::text = 'activity' OR stattype::text = 'logins')
@@ -560,7 +560,7 @@ CREATE TABLE prefix_stats_monthly (
courseid INTEGER NOT NULL default 0,
roleid INTEGER NOT NULL default 0,
timeend INTEGER NOT NULL default 0,
- stattype varchar(20) NOT NULL default '',
+ stattype varchar(20) NOT NULL default 'activity',
stat1 INTEGER NOT NULL default 0,
stat2 INTEGER NOT NULL default 0,
CHECK (stattype::text = 'enrolments' OR stattype::text = 'activity' OR stattype::text = 'logins')
View
2 lib/statslib.php
@@ -1190,7 +1190,7 @@ function stats_upgrade_table_for_roles ($period) {
$table->addFieldInfo('timeend', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED,
XMLDB_NOTNULL, null, null, null, null);
$table->addFieldInfo('stattype', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL,
- null, XMLDB_ENUM, array('enrolments', 'activity', 'logins'), null);
+ null, XMLDB_ENUM, array('enrolments', 'activity', 'logins'), 'activity');
$table->addFieldInfo('stat1', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED,
XMLDB_NOTNULL, null, null, null, null);
$table->addFieldInfo('stat2', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED,

0 comments on commit 1282edc

Please sign in to comment.
Something went wrong with that request. Please try again.