Merged from MOODLE_15_STABLE: (ish, version numbers different): Add an index where we really need it - block_instance.pagetype

This commit is contained in:
mjollnir_
2005-09-02 05:00:59 +00:00
parent f64376bfc8
commit c69dbe691e
5 changed files with 18 additions and 4 deletions
+6 -1
View File
@@ -139,7 +139,7 @@ global $CFG;
}
if ($oldversion < 2005022401 && $result) { // Mass cleanup of bad upgrade scripts
modify_database('','CREATE INDEX prefix_block_instance_pageid_idx ON prefix_block_instance (pageid)');
execute_sql("CREATE INDEX {$CFG->prefix}block_instance_pageid_idx ON {$CFG->prefix}block_instance (pageid)",false); // this one should be quiet...
modify_database('','ALTER TABLE prefix_block_instance ALTER pagetype SET DEFAULT \'\'');
modify_database('','ALTER TABLE prefix_block_instance ALTER position SET DEFAULT \'\'');
modify_database('','ALTER TABLE prefix_block_instance ALTER pagetype SET NOT NULL');
@@ -158,6 +158,11 @@ global $CFG;
);");
}
if ($oldversion < 2005090200) {
execute_sql("CREATE INDEX {$CFG->prefix}block_instance_pagetype_idx ON {$CFG->prefix}block_instance (pagetype);",false); // do it silently, in case it's already there from 1.5
modify_database('','CREATE INDEX prefix_block_pinned_pagetype_idx ON prefix_block_pinned (pagetype);');
}
//Finally, return result
return $result;
}