Page MenuHomePhabricator

Please create and run a maintenance script to consolidate some user rights changes made at Meta-Wiki
Closed, ResolvedPublic

Description

Please see bug 20446

Please create a maintenance script to convert all user rights log entries at Meta-Wiki in the type User:A@metawiki to User:A.

Example: https://meta.wikimedia.org/w/index.php?title=Special%3ALog&type=rights&user=&page=User%3AMike.lifeguard%40metawiki&year=&month=-1&tagfilter=; although there are a lot more from other stewards before the bug I cite above was fixed.

This, as it is, splits the user rights log of a single user in two, which is annoying.

Best regards.


Version: wmf-deployment
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=20446

Details

Reference
bz43913

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:39 AM
bzimport set Reference to bz43913.
bzimport added a subscriber: Unknown Object (MLST).

Priority set to low, tho should be done eventually.

Based on Tyler Romeo's comments I think this single SQL query may actually do it:

UPDATE logging SET log_title = SUBSTR(log_title, 1, INSTR(log_title, '@metawiki') - 1) WHERE log_title LIKE '%@metawiki';

Therefore we may not even need a maintenance script.

Third-party users of the interwiki userrights system would just need to replace @metawiki with their $wgUserrightsInterwikiDelimiter and wiki ID (database name and table prefix IIRC).

pgehres wrote:

I see 272 rows in metawiki.logging for 71 different users. I also can confirm that the above query generates the expected outcome when run as a select on a slave.

mysql:wikiadmin@db1041 [metawiki]> UPDATE logging SET log_title = SUBSTR(log_title, 1, INSTR(log_title,

-> '@metawiki') - 1) WHERE log_title LIKE '%@metawiki';

Query OK, 272 rows affected (16.55 sec)
Rows matched: 272 Changed: 272 Warnings: 0