Indexes for label and version bump (honoring partial freeze)

This commit is contained in:
mjollnir_
2004-11-19 02:12:58 +00:00
parent 51cf993598
commit 96522de058
5 changed files with 12 additions and 2 deletions
+3
View File
@@ -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;
}
+2 -1
View 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');
+4
View File
@@ -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;
}
+2
View 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');
+1 -1
View 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 = 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)