Rename filter_timestamp index in a different file

Otherwise there might be interferences with the remove-afl_filter patch.

Bug: T291725
Change-Id: If339663d491e1da4a118c13cd667d228365b4864
This commit is contained in:
Daimona Eaytoy 2021-10-20 15:22:04 +02:00
parent 04552f00db
commit 5e95676e99
3 changed files with 10 additions and 2 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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',