diff --git a/db_patches/mysql/patch-rename-filter_timestamp-index.sql b/db_patches/mysql/patch-rename-filter_timestamp-index.sql new file mode 100644 index 000000000..603e62c12 --- /dev/null +++ b/db_patches/mysql/patch-rename-filter_timestamp-index.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*_*/abuse_filter_log DROP INDEX /*i*/filter_timestamp; +CREATE INDEX /*i*/afl_filter_timestamp ON /*$wgDBprefix*/abuse_filter_log (afl_filter,afl_timestamp); diff --git a/db_patches/mysql/patch-rename-indexes.sql b/db_patches/mysql/patch-rename-indexes.sql index fc2bceee0..0f31c7ab1 100644 --- a/db_patches/mysql/patch-rename-indexes.sql +++ b/db_patches/mysql/patch-rename-indexes.sql @@ -5,12 +5,10 @@ ALTER TABLE /*_*/abuse_filter ADD INDEX /*i*/af_group_enabled(af_group,af_enabled,af_id); ALTER TABLE /*_*/abuse_filter_log - DROP INDEX /*i*/filter_timestamp, DROP INDEX /*i*/filter_timestamp_full, DROP INDEX /*i*/user_timestamp, DROP INDEX /*i*/page_timestamp, DROP INDEX /*i*/ip_timestamp; -CREATE INDEX /*i*/afl_filter_timestamp ON /*$wgDBprefix*/abuse_filter_log (afl_filter,afl_timestamp); CREATE INDEX /*i*/afl_filter_timestamp_full ON /*$wgDBprefix*/abuse_filter_log (afl_global,afl_filter_id,afl_timestamp); CREATE INDEX /*i*/afl_user_timestamp ON /*$wgDBprefix*/abuse_filter_log (afl_user,afl_user_text,afl_timestamp); CREATE INDEX /*i*/afl_page_timestamp ON /*$wgDBprefix*/abuse_filter_log (afl_namespace, afl_title, afl_timestamp); diff --git a/includes/Hooks/Handlers/SchemaChangesHandler.php b/includes/Hooks/Handlers/SchemaChangesHandler.php index 84df85c55..e0f7d9661 100644 --- a/includes/Hooks/Handlers/SchemaChangesHandler.php +++ b/includes/Hooks/Handlers/SchemaChangesHandler.php @@ -86,6 +86,14 @@ class SchemaChangesHandler implements LoadExtensionSchemaUpdatesHook { "$dir/mysql/patch-rename-wiki-timestamp-index.sql", true ); + // This one is also separate to avoid interferences with the afl_filter field removal below. + $updater->renameExtensionIndex( + 'abuse_filter_log', + 'filter_timestamp', + 'afl_filter_timestamp', + "$dir/mysql/patch-rename-filter_timestamp-index.sql", + true + ); } $updater->dropExtensionField( 'abuse_filter_log',