Permalink
Browse files

Indexes for label and version bump (honoring partial freeze)

  • Loading branch information...
1 parent 51cf993 commit 96522de058105ee5906824dbea67ce6bd5da59d8 mjollnir_ committed Nov 19, 2004
Showing with 12 additions and 2 deletions.
  1. +3 −0 mod/label/db/mysql.php
  2. +2 −1 mod/label/db/mysql.sql
  3. +4 −0 mod/label/db/postgres7.php
  4. +2 −0 mod/label/db/postgres7.sql
  5. +1 −1 mod/label/version.php
@@ -15,6 +15,9 @@ function label_upgrade($oldversion) {
modify_database("", "INSERT INTO prefix_log_display VALUES ('label', 'update', 'quiz', 'name');");
}
+ if ($oldversion < 2004060401) {
+ modify_database('','ALTER TABLE prefix_label ADD INDEX course (course);');
+ }
return true;
}
@@ -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');
@@ -14,6 +14,10 @@ function label_upgrade($oldversion) {
modify_database("", "INSERT INTO prefix_log_display VALUES ('label', 'add', 'quiz', 'name');");
modify_database("", "INSERT INTO prefix_log_display VALUES ('label', 'update', 'quiz', 'name');");
}
+
+ if ($oldversion < 2004060401) {
+ modify_database('','CREATE INDEX prefix_label_course_idx ON prefix_label (course);');
+ }
return true;
}
@@ -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');
@@ -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 = 2004060401; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2004052505; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)

0 comments on commit 96522de

Please sign in to comment.