Commit 1d916835 authored by akrherz's avatar akrherz Committed by Guus der Kinderen

OF-1254 drop ofMucConvLog_msg_id index prior to creating it

This is an attempt to workaround an issue introduced whereby the database schema version is incorrect.  More info is here
https://discourse.igniterealtime.org/t/79916

The mysql change worked for me on mariadb 5.5.56
parent ee307ce7
DROP INDEX ofMucConvLog_msg_id IF EXISTS;
CREATE INDEX ofMucConvLog_msg_id ON ofMucConversationLog (messageID);
UPDATE ofVersion SET version = 25 WHERE name = 'openfire';
DROP INDEX ofMucConvLog_msg_id IF EXISTS;
CREATE INDEX ofMucConvLog_msg_id ON ofMucConversationLog (messageID);
UPDATE ofVersion SET version = 25 WHERE name = 'openfire';
ALTER TABLE ofMucConversationLog ADD INDEX ofMucConvLog_msg_id (messageID);
set @exist := (select count(*) from information_schema.statistics where table_name = 'ofMucConversationLog' and index_name = 'ofMucConvLog_msg_id' and table_schema = database());
set @sqlstmt := if( @exist > 0, 'select ''INFO: Index already exists.''', 'create index ofMucConvLog_msg_id on ofMucConversationLog (messageID)');
PREPARE stmt FROM @sqlstmt;
EXECUTE stmt;
UPDATE ofVersion SET version = 25 WHERE name = 'openfire';
DROP INDEX IF EXISTS ofMucConvLog_msg_id;
CREATE INDEX ofMucConvLog_msg_id ON ofMucConversationLog (messageID);
UPDATE ofVersion SET version = 25 WHERE name = 'openfire';
DROP INDEX IF EXISTS ofMucConvLog_msg_id;
CREATE INDEX ofMucConvLog_msg_id ON ofMucConversationLog (messageID);
UPDATE ofVersion SET version = 25 WHERE name = 'openfire';
DROP INDEX IF EXISTS ofMucConvLog_msg_id;
CREATE INDEX ofMucConvLog_msg_id ON ofMucConversationLog (messageID);
UPDATE ofVersion SET version = 25 WHERE name = 'openfire';
DROP INDEX IF EXISTS ofMucConvLog_msg_id;
CREATE INDEX ofMucConvLog_msg_id ON ofMucConversationLog (messageID);
UPDATE ofVersion SET version = 25 WHERE name = 'openfire';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment