]> git.mjollnir.org Git - moodle.git/commitdiff
changing tags->text to varchar 20, created index on tags(type, userid), and tags...
authortoyomoyo <toyomoyo>
Mon, 24 Apr 2006 05:53:06 +0000 (05:53 +0000)
committertoyomoyo <toyomoyo>
Mon, 24 Apr 2006 05:53:06 +0000 (05:53 +0000)
lib/db/mysql.php
lib/db/mysql.sql
lib/db/postgres7.php
lib/db/postgres7.sql
version.php

index 7e9675fa0f49c5ab6a795d7224d579adf71aa4e3..d6a41944d2c0c9ea8b90bd165b5819a18445a2e8 100644 (file)
@@ -1828,7 +1828,14 @@ function main_upgrade($oldversion=0) {
         }
     }
     
+    // change tags->type to varchar(20), adding 2 indexes for tags table.
+    if ($oldversion < 2006042401) {
+        table_column('tags','type','type','varchar','20','','','not null');
+        modify_database('',"ALTER TABLE prefix_tags ADD INDEX tags_typeuserid_idx (type(20), userid)");
+        modify_database('',"ALTER TABLE prefix_tags ADD INDEX tags_text(text(255))");
+    }
+
     return $result;
 }
 
-?>
\ No newline at end of file
+?>
index d93157a0b318e45477515272d2dc5df9110026f9..66566917939a0550982ed919f7e79b2fa68cdf5c 100644 (file)
@@ -878,7 +878,9 @@ CREATE TABLE prefix_tags (
   `id` int(10) NOT NULL auto_increment,
   `type` varchar(255) NOT NULL default 'official',
   `userid` int(10) NOT NULL default '0',
-  `text` varchar(255) NOT NULL default '',
+  `text` varchar(20) NOT NULL default '',
+  KEY `tags_typeuserid_idx` (`type`, `userid`),
+  KEY `tags_text` (`text`);
   PRIMARY KEY  (`id`)
 ) TYPE=MyISAM COMMENT ='tags structure for moodle.';
 
index 41386e847ef0caa9124473a160e1edf792f9f19b..49ab404c88104eb1e29cdcf8e8b35340f703ed18 100644 (file)
@@ -1523,6 +1523,12 @@ function main_upgrade($oldversion=0) {
             }
         }
     }
+    
+    // add 2 indexes to tags table
+    if ($oldversion < 2006042401) {
+        modify_database('',"CREATE INDEX tags_typeuserid_idx ON prefix_tags (type, userid);");
+        modify_database('',"CREATE INDEX tags_text_idx ON prefix_tags (text);");
+    }
 
     return $result;
 }
index 71ba19c7c0fa0ba9b3c81f033bddaf5d6d2d1ddf..85b07d41da87fabff0335fcc78f82b3b6577fd2d 100644 (file)
@@ -655,6 +655,8 @@ CREATE TABLE prefix_tags (
   userid INTEGER NOT NULL default 0,
   text varchar(255) NOT NULL default ''
 );
+CREATE INDEX tags_typeuserid_idx ON prefix_tags (type, userid);
+CREATE INDEX tags_text_idx ON prefix_tags (text);
 
 CREATE TABLE prefix_blog_tag_instance (
   id SERIAL PRIMARY KEY,
index f47720e081a2ed2ed7743ad6ffa93a413a89ade5..5319f800a15a88cac5798ba2e3a30eee46e1c0cf 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 = 2006042400;  // YYYYMMDD = date
+   $version = 2006042401;  // YYYYMMDD = date
                            //       XY = increments within a single day
 
    $release = '1.6 Beta 3';    // Human-friendly version name