PRIMARY KEY (id))");
}
+
+ if ($oldversion < 2004121600) {
+ modify_database('',"CREATE TABLE `prefix_message` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `useridfrom` int(10) NOT NULL default '0',
+ `useridto` int(10) NOT NULL default '0',
+ `message` text NOT NULL,
+ `timemodified` int(10) NOT NULL default '0',
+ `messagetype` varchar(50) NOT NULL default '',
+ PRIMARY KEY (`id`),
+ KEY `useridfrom` (`useridfrom`),
+ KEY `useridto` (`useridto`)
+ ) TYPE=MyISAM COMMENT='Stores all unread messages';");
+
+ modify_database('',"CREATE TABLE `prefix_message_read` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `useridfrom` int(10) NOT NULL default '0',
+ `useridto` int(10) NOT NULL default '0',
+ `message` text NOT NULL,
+ `timemodified` int(10) NOT NULL default '0',
+ `messagetype` varchar(50) NOT NULL default '',
+ `mailed` tinyint(1) NOT NULL default '0',
+ PRIMARY KEY (`id`),
+ KEY `useridfrom` (`useridfrom`),
+ KEY `useridto` (`useridto`)
+ ) TYPE=MyISAM COMMENT='Stores all messages that have been read';");
+ }
return $result;
) TYPE=MyISAM;
# --------------------------------------------------------
+#
+# Table structure for table `dst_preset`
+#
+
+CREATE TABLE `prefix_dst_preset` (
+ `id` int(10) NOT NULL auto_increment,
+ `name` char(48) NOT NULL default '',
+ `apply_offset` tinyint(3) NOT NULL default '0',
+ `activate_index` tinyint(1) NOT NULL default '1',
+ `activate_day` tinyint(1) NOT NULL default '1',
+ `activate_month` tinyint(2) NOT NULL default '1',
+ `activate_time` char(5) NOT NULL default '03:00',
+ `deactivate_index` tinyint(1) NOT NULL default '1',
+ `deactivate_day` tinyint(1) NOT NULL default '1',
+ `deactivate_month` tinyint(2) NOT NULL default '2',
+ `deactivate_time` char(5) NOT NULL default '03:00',
+ `last_change` int(10) NOT NULL default '0',
+ `next_change` int(10) NOT NULL default '0',
+ `current_offset` tinyint(3) NOT NULL default '0',
+ PRIMARY KEY (`id`)
+) TYPE=MyISAM;
+
+# --------------------------------------------------------
+
#
# Table structure for table `event`
#
) TYPE=MyISAM COMMENT='For a particular module/action, specifies a moodle table/field.';
# --------------------------------------------------------
+#
+# Table structure for table `message`
+#
+
+CREATE TABLE `prefix_message` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `useridfrom` int(10) NOT NULL default '0',
+ `useridto` int(10) NOT NULL default '0',
+ `message` text NOT NULL,
+ `timemodified` int(10) NOT NULL default '0',
+ `messagetype` varchar(50) NOT NULL default '',
+ PRIMARY KEY (`id`),
+ KEY `useridfrom` (`useridfrom`),
+ KEY `useridto` (`useridto`)
+) TYPE=MyISAM COMMENT='Stores all unread messages';
+# --------------------------------------------------------
+
+#
+# Table structure for table `message_read`
+#
+
+CREATE TABLE `prefix_message_read` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `useridfrom` int(10) NOT NULL default '0',
+ `useridto` int(10) NOT NULL default '0',
+ `message` text NOT NULL,
+ `timemodified` int(10) NOT NULL default '0',
+ `messagetype` varchar(50) NOT NULL default '',
+ `mailed` tinyint(1) NOT NULL default '0',
+ PRIMARY KEY (`id`),
+ KEY `useridfrom` (`useridfrom`),
+ KEY `useridto` (`useridto`)
+) TYPE=MyISAM COMMENT='Stores all messages that have been read';
+# --------------------------------------------------------
+
#
# Table structure for table `modules`
#
if ($oldversion < 2004121400) {
table_column('groups', '', 'password', 'varchar', '50', '', '', 'not null', 'description');
}
-
+
+ if ($oldversion < 2004121600) {
+ modify_database('',"CREATE TABLE prefix_dst_preset (
+ id SERIAL PRIMARY KEY,
+ name varchar(48) NOT NULL default '',
+ apply_offset integer NOT NULL default '0',
+ activate_index integer NOT NULL default '1',
+ activate_day integer NOT NULL default '1',
+ activate_month integer NOT NULL default '1',
+ activate_time char(5) NOT NULL default '03:00',
+ deactivate_index integer NOT NULL default '1',
+ deactivate_day integer NOT NULL default '1',
+ deactivate_month integer NOT NULL default '2',
+ deactivate_time char(5) NOT NULL default '03:00',
+ last_change int(10) NOT NULL default '0',
+ next_change int(10) NOT NULL default '0',
+ current_offset integer NOT NULL default '0'
+ ) TYPE=MyISAM;");
+
+
+ modify_database('',"CREATE TABLE prefix_message (
+ id SERIAL PRIMARY KEY,
+ useridfrom integer NOT NULL default '0',
+ useridto integer NOT NULL default '0',
+ message text,
+ timemodified integer NOT NULL default '0',
+ messagetype varchar(50) NOT NULL default ''
+ );
+
+ CREATE INDEX prefix_message_useridfrom_idx ON prefix_message (useridfrom);
+ CREATE INDEX prefix_message_useridto_idx ON prefix_message (useridto);
+
+ CREATE TABLE prefix_message_read (
+ id SERIAL PRIMARY KEY,
+ useridfrom integer NOT NULL default '0',
+ useridto integer NOT NULL default '0',
+ message text,
+ timemodified integer NOT NULL default '0',
+ messagetype varchar(50) NOT NULL default '',
+ mailed integer NOT NULL default '0'
+ );
+
+ CREATE INDEX prefix_message_read_useridfrom_idx ON prefix_message_read (useridfrom);
+ CREATE INDEX prefix_message_read_useridto_idx ON prefix_message_read (useridto);
+ ");
+ }
+
return $result;
}
CREATE INDEX prefix_course_sections_coursesection_idx ON prefix_course_sections (course,section);
+CREATE TABLE prefix_dst_preset (
+ id SERIAL PRIMARY KEY,
+ name varchar(48) NOT NULL default '',
+ apply_offset integer NOT NULL default '0',
+ activate_index integer NOT NULL default '1',
+ activate_day integer NOT NULL default '1',
+ activate_month integer NOT NULL default '1',
+ activate_time char(5) NOT NULL default '03:00',
+ deactivate_index integer NOT NULL default '1',
+ deactivate_day integer NOT NULL default '1',
+ deactivate_month integer NOT NULL default '2',
+ deactivate_time char(5) NOT NULL default '03:00',
+ last_change int(10) NOT NULL default '0',
+ next_change int(10) NOT NULL default '0',
+ current_offset integer NOT NULL default '0'
+) TYPE=MyISAM;
+
CREATE TABLE prefix_event (
id SERIAL PRIMARY KEY,
name varchar(255) NOT NULL default '',
field varchar(40) NOT NULL default ''
);
+CREATE TABLE prefix_message (
+ id SERIAL PRIMARY KEY,
+ useridfrom integer NOT NULL default '0',
+ useridto integer NOT NULL default '0',
+ message text,
+ timemodified integer NOT NULL default '0',
+ messagetype varchar(50) NOT NULL default ''
+);
+
+CREATE INDEX prefix_message_useridfrom_idx ON prefix_message (useridfrom);
+CREATE INDEX prefix_message_useridto_idx ON prefix_message (useridto);
+
+CREATE TABLE prefix_message_read (
+ id SERIAL PRIMARY KEY,
+ useridfrom integer NOT NULL default '0',
+ useridto integer NOT NULL default '0',
+ message text,
+ timemodified integer NOT NULL default '0',
+ messagetype varchar(50) NOT NULL default '',
+ mailed integer NOT NULL default '0'
+);
+
+CREATE INDEX prefix_message_read_useridfrom_idx ON prefix_message_read (useridfrom);
+CREATE INDEX prefix_message_read_useridto_idx ON prefix_message_read (useridto);
+
CREATE TABLE prefix_modules (
id SERIAL PRIMARY KEY,
name varchar(20) NOT NULL default '',
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2004121500; // YYYYMMDD = date of first major branch release 1.4
+ $version = 2004121600; // YYYYMMDD = date of first major branch release 1.4
// XY = increments within a single day
$release = '1.5 UNSTABLE DEVELOPMENT'; // Human-friendly version name