]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from MOODLE_14_STABLE: Indexes for label and version bump (honoring partial...
authormjollnir_ <mjollnir_>
Fri, 19 Nov 2004 03:05:38 +0000 (03:05 +0000)
committermjollnir_ <mjollnir_>
Fri, 19 Nov 2004 03:05:38 +0000 (03:05 +0000)
mod/label/db/mysql.php
mod/label/db/mysql.sql
mod/label/db/postgres7.php
mod/label/db/postgres7.sql
mod/label/version.php

index 20f8fa48a1db4a7a91c72fb078365343f6336e62..9d68d8e3185b5ad5cf204ca8bb1784cd6e2b1623 100644 (file)
@@ -30,9 +30,11 @@ function label_upgrade($oldversion) {
 
     }
 
+    if ($oldversion < 2004111200) { //DROP first
+        execute_sql("ALTER TABLE {$CFG->prefix}label DROP INDEX course;",false);
 
-
-
+        modify_database('','ALTER TABLE prefix_label ADD INDEX course (course);');
+    }
 
     return true;
 
index 836a64e90ff7a9f7f2c22607ba2554a8f8520880..c3a3f4dd51f5da802f9072f87e216dc12d59564e 100644 (file)
@@ -4,7 +4,8 @@ CREATE TABLE `prefix_label` (
   `name` varchar(255) NOT NULL default '',
   `content` text NOT NULL,
   `timemodified` int(10) unsigned NOT NULL default '0',
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY course (course)
 ) COMMENT='Defines labels';
 
 INSERT INTO prefix_log_display VALUES ('label', 'add', 'quiz', 'name');
index 1d549cdf240a26dba636d7afa08434c685744de0..e42ae4eaf74c463bddd74e235da00f4f9ab1ff4e 100644 (file)
@@ -30,7 +30,11 @@ function label_upgrade($oldversion) {
 
     }
 
+    if ($oldversion < 2004111200) { //DROP first
+        execute_sql("DROP INDEX {$CFG->prefix}label_course_idx;",false);
 
+        modify_database('','CREATE INDEX prefix_label_course_idx ON prefix_label (course);');
+    }
 
     return true;
 
index bcf4ef2bc2cda4d9042fdefd6ffa6ec8257af219..8a90726ca7c6c6832b03559aac8272502d0e5fbf 100644 (file)
@@ -6,5 +6,7 @@ CREATE TABLE prefix_label (
   timemodified integer NOT NULL default '0'
 );
 
+CREATE INDEX prefix_label_course_idx ON prefix_label (course);
+
 INSERT INTO prefix_log_display VALUES ('label', 'add', 'quiz', 'name');
 INSERT INTO prefix_log_display VALUES ('label', 'update', 'quiz', 'name');
index 0d2a4c4f257ba99f4bb0dc91ee99bc0b510299fe..00b8102e040d11bdf70db792b1bde1047b05d6b0 100644 (file)
@@ -5,7 +5,7 @@
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 /////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2004060400;  // The current module version (Date: YYYYMMDDXX)
+$module->version  = 2004111200;  // The current module version (Date: YYYYMMDDXX)
 $module->requires = 2004052505;  // Requires this Moodle version
 $module->cron     = 0;           // Period for cron to check this module (secs)