Skip to content
Browse files

moodle16cleanup: lib/db correct prefix, patch by Tim Hunt for bug 5515

  • Loading branch information...
1 parent 2a0f40e commit 05acf8e974b07605be9605fb2d2d8c60376477bb martinlanghoff committed May 17, 2006
Showing with 26 additions and 8 deletions.
  1. +18 −0 lib/db/postgres7.php
  2. +8 −8 lib/db/postgres7.sql
18 lib/db/postgres7.php
@@ -1557,6 +1557,24 @@ function main_upgrade($oldversion=0) {
modify_database('', 'ALTER TABLE prefix_log_display
ALTER COLUMN module TYPE varchar(20)');
+ modify_database("","DROP INDEX id_user_idx");
+ modify_database("","DROP INDEX post_lastmodified_idx");
+ modify_database("","DROP INDEX post_subject_idx");
+ modify_database('',"DROP INDEX bti_entryid_idx");
+ modify_database('',"DROP INDEX bti_tagid_idx");
+ modify_database('',"DROP INDEX post_module_idx");
+ modify_database('',"DROP INDEX tags_typeuserid_idx");
+ modify_database('',"DROP INDEX tags_text_idx");
+ modify_database("","CREATE INDEX {$CFG->prefix}id_user_idx ON prefix_post (id, courseid);");
+ modify_database("","CREATE INDEX {$CFG->prefix}post_lastmodified_idx ON prefix_post (lastmodified);");
+ modify_database("","CREATE INDEX {$CFG->prefix}post_subject_idx ON prefix_post (subject);");
+ modify_database('',"CREATE INDEX {$CFG->prefix}bti_entryid_idx ON prefix_blog_tag_instance (entryid);");
+ modify_database('',"CREATE INDEX {$CFG->prefix}bti_tagid_idx ON prefix_blog_tag_instance (tagid);");
+ modify_database('',"CREATE INDEX {$CFG->prefix}post_module_idx ON prefix_post (moduleid);");
+ modify_database('',"CREATE INDEX {$CFG->prefix}tags_typeuserid_idx ON prefix_tags (type, userid);");
+ modify_database('',"CREATE INDEX {$CFG->prefix}tags_text_idx ON prefix_tags (text);");
16 lib/db/postgres7.sql
@@ -644,19 +644,19 @@ CREATE TABLE prefix_post (
created INTEGER NOT NULL default '0'
-CREATE INDEX id_user_idx ON prefix_post (id, courseid);
-CREATE INDEX post_lastmodified_idx ON prefix_post (lastmodified);
-CREATE INDEX post_module_idx ON prefix_post (module);
-CREATE INDEX post_subject_idx ON prefix_post (subject);
+CREATE INDEX prefix_id_user_idx ON prefix_post (id, courseid);
+CREATE INDEX prefix_post_lastmodified_idx ON prefix_post (lastmodified);
+CREATE INDEX prefix_post_module_idx ON prefix_post (moduleid);
+CREATE INDEX prefix_post_subject_idx ON prefix_post (subject);
CREATE TABLE prefix_tags (
type varchar(255) NOT NULL default 'official',
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 INDEX prefix_tags_typeuserid_idx ON prefix_tags (type, userid);
+CREATE INDEX prefix_tags_text_idx ON prefix_tags (text);
CREATE TABLE prefix_blog_tag_instance (
@@ -667,8 +667,8 @@ CREATE TABLE prefix_blog_tag_instance (
userid integer NOT NULL default 0,
timemodified integer NOT NULL default 0
-CREATE INDEX bti_entryid_idx ON prefix_blog_tag_instance (entryid);
-CREATE INDEX bti_tagid_idx ON prefix_blog_tag_instance (tagid);
+CREATE INDEX prefix_bti_entryid_idx ON prefix_blog_tag_instance (entryid);
+CREATE INDEX prefix_bti_tagid_idx ON prefix_blog_tag_instance (tagid);
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('user', 'view', 'user', 'firstname||\' \'||lastname');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'user report', 'user', 'firstname||\' \'||lastname');

0 comments on commit 05acf8e

Please sign in to comment.
Something went wrong with that request. Please try again.