]> git.mjollnir.org Git - moodle.git/commitdiff
Added timemodified to blog_tag_instance table and some indexes
authormoodler <moodler>
Mon, 20 Mar 2006 07:40:55 +0000 (07:40 +0000)
committermoodler <moodler>
Mon, 20 Mar 2006 07:40:55 +0000 (07:40 +0000)
lib/db/mysql.php
lib/db/mysql.sql
lib/db/postgres7.php
lib/db/postgres7.sql
version.php

index 13c3f4733883695be0633918b0f75f03259b1924..51a905793404c141a5a643216cf389e1ce76362f 100644 (file)
@@ -1740,6 +1740,12 @@ function main_upgrade($oldversion=0) {
         modify_database('',"UPDATE prefix_post SET module = 'blog';");
     }
 
+    if ($oldversion < 2006032001) {
+        table_column('blog_tag_instance','','timemodified','integer','10','unsigned','0','not null', 'userid');
+        modify_database('',"ALTER TABLE prefix_blog_tag_instance ADD INDEX bti_entryid_idx (entryid);");
+        modify_database('',"ALTER TABLE prefix_blog_tag_instance ADD INDEX bti_tagid_idx (tagid);");
+    }
+
     return $result;
 }
 
index 9708361266501eea667dcbbcfdf36a73099210f9..11c6fad48178680c4d4ff8a13b19c6a7e5504f84 100644 (file)
@@ -849,16 +849,16 @@ CREATE TABLE prefix_post (
   `id` int(11) NOT NULL auto_increment,
   `module` varchar(20) NOT NULL default '',
   `userid` int(11) NOT NULL default '0',
-  `courseid` int(11) NOT NULL default'0',
-  `groupid` int(11) NOT NULL default'0',
-  `moduleid` int(11) NOT NULL default'0',
-  `coursemoduleid` int(11) NOT NULL default'0',
+  `courseid` int(11) NOT NULL default '0',
+  `groupid` int(11) NOT NULL default '0',
+  `moduleid` int(11) NOT NULL default '0',
+  `coursemoduleid` int(11) NOT NULL default '0',
   `subject` varchar(128) NOT NULL default '',
   `summary` longtext,
   `content` longtext,
   `uniquehash` varchar(128) NOT NULL default '',
-  `rating` int(11) NOT NULL default'0',
-  `format` int(11) NOT NULL default'0',
+  `rating` int(11) NOT NULL default '0',
+  `format` int(11) NOT NULL default '0',
   `publishstate` enum('draft','site','public') NOT NULL default 'draft',
   `lastmodified` int(10) NOT NULL default '0',
   `created` int(10) NOT NULL default '0',
@@ -874,7 +874,7 @@ CREATE TABLE prefix_post (
 CREATE TABLE prefix_tags (
   `id` int(11) NOT NULL auto_increment,
   `type` varchar(255) NOT NULL default 'official',
-  `userid` int(11) NOT NULL default'0',
+  `userid` int(11) NOT NULL default '0',
   `text` varchar(255) NOT NULL default '',
   PRIMARY KEY  (`id`)
 ) TYPE=MyISAM COMMENT ='tags structure for moodle.';
@@ -882,11 +882,14 @@ CREATE TABLE prefix_tags (
 # instance of a tag for a blog
 CREATE TABLE prefix_blog_tag_instance (
   `id` int(11) NOT NULL auto_increment,
-  `entryid` int(11) NOT NULL default'0',
-  `tagid` int(11) NOT NULL default'0',
-  `groupid` int(11) NOT NULL default'0',
-  `courseid` int(11) NOT NULL default'0',
-  `userid` int(11) NOT NULL default'0',
+  `entryid` int(11) NOT NULL default '0',
+  `tagid` int(11) NOT NULL default '0',
+  `groupid` int(11) NOT NULL default '0',
+  `courseid` int(11) NOT NULL default '0',
+  `userid` int(11) NOT NULL default '0',
+  `timemodified` int(10) unsigned NOT NULL default '0',
+  KEY `bti_entryid_idx` (`entryid`),
+  KEY `bti_tagid_idx` (`tagid`),
   PRIMARY KEY  (`id`)
 ) TYPE=MyISAM COMMENT ='tag instance for blogs.';
 
index 305f254b233d2061e8a10b88dcba09e4641ae9ce..2bc5474b780f8310b399df71844c4bc531802e8f 100644 (file)
@@ -1477,6 +1477,12 @@ function main_upgrade($oldversion=0) {
         modify_database('',"UPDATE prefix_post SET module = 'blog';");
     }
 
+    if ($oldversion < 2006032001) {
+        table_column('blog_tag_instance','','timemodified','integer','10','unsigned','0','not null', 'userid');
+        modify_database('',"ALTER TABLE prefix_blog_tag_instance ADD INDEX bti_entryid_idx (entryid);");
+        modify_database('',"ALTER TABLE prefix_blog_tag_instance ADD INDEX bti_tagid_idx (tagid);");
+    }
+
     return $result;
 }
 
index b2a0d4186c0ba4441906fbd3138be104a9bdbe5d..50a4c90a4529472342685c96f6d2096f0ef78b8f 100644 (file)
@@ -660,7 +660,10 @@ CREATE TABLE prefix_blog_tag_instance (
   groupid integer NOT NULL default 0,
   courseid integer NOT NULL default 0,
   userid integer NOT NULL default 0
+  timemodified integer NOT NULL default 0
 );
+CREATE INDEX bti_entryid_idx ON prefix_blog_tag_instance (entryid);
+CREATE INDEX bti_tagid_idx ON prefix_blog_tag_instance (tagid);
 
 INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'firstname||\' \'||lastname');
 INSERT INTO prefix_log_display VALUES ('course', 'user report', 'user', 'firstname||\' \'||lastname');
index 6a2ce9ecf4e30d5e0755b3b64d1984bf32a0803f..24e19a3bc7278e52d53010a79c4feb0ceba11c4d 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-   $version = 2006032000;  // YYYYMMDD = date
+   $version = 2006032001;  // YYYYMMDD = date
                            //       XY = increments within a single day
 
    $release = '1.6 development';    // Human-friendly version name