Merged from MOODLE_14_STABLE: Indexes for chat and version bump
This commit is contained in:
@@ -20,6 +20,28 @@ function chat_upgrade($oldversion) {
|
||||
modify_database("", "INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');");
|
||||
}
|
||||
|
||||
if ($oldversion < 2004111200) { //drop them first to avoid collisions with upgrades from 1.4.2+
|
||||
execute_sql('DROP INDEX prefix_chat_course_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_chat_messages_chatid_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_chat_messages_userid_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_chat_messages_groupid_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_chat_messages_timemodifiedchatid_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_chat_users_chatid_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_chat_users_userid_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_chat_users_groupid_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_chat_users_lastping_idx;',false);
|
||||
|
||||
modify_database('','CREATE INDEX prefix_chat_course_idx ON prefix_chat(course);');
|
||||
modify_database('','CREATE INDEX prefix_chat_messages_chatid_idx ON prefix_chat_messages (chatid);');
|
||||
modify_database('','CREATE INDEX prefix_chat_messages_userid_idx ON prefix_chat_messages (userid);');
|
||||
modify_database('','CREATE INDEX prefix_chat_messages_groupid_idx ON prefix_chat_messages (groupid);');
|
||||
modify_database('','CREATE INDEX prefix_chat_messages_timemodifiedchatid_idx ON prefix_chat_messages(timestamp,chatid);');
|
||||
modify_database('','CREATE INDEX prefix_chat_users_chatid_idx ON prefix_chat_users (chatid);');
|
||||
modify_database('','CREATE INDEX prefix_chat_users_userid_idx ON prefix_chat_users (userid);');
|
||||
modify_database('','CREATE INDEX prefix_chat_users_groupid_idx ON prefix_chat_users (groupid);');
|
||||
modify_database('','CREATE INDEX prefix_chat_users_lastping_idx ON prefix_chat_users (lastping);');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user