Tietew wrote:
On Mon, 10 Jul 2006 17:05:31 +1000 In article e8su7s$h8r$1@sea.gmane.org [[Wikitech-l] User block changes] Tim Starling t.starling@physics.unimelb.edu.au wrote:
during the schema update. I *think* the winning block will be the earliest one, with all others silently deleted, but we'll see for sure during the update.
How about adding "ORDER BY ipb_id" to patch-ipb_anon_only.sql's INSERT INTO ipblocks_newunique. It can force to leave each earlist block.
INSERT IGNORE INTO /*$wgDBprefix*/ipblocks_newunique (ipb_id, ipb_address, ipb_user, ipb_by, ipb_reason, ipb_timestamp, ipb_auto, ipb_expiry, ipb_range_start, ipb_range_end, ipb_anon_only, ipb_create_account) SELECT ipb_id, ipb_address, ipb_user, ipb_by, ipb_reason, ipb_timestamp, ipb_auto, ipb_expiry, ipb_range_start, ipb_range_end, 0 , ipb_user=0 FROM /*$wgDBprefix*/ipblocks ORDER BY ipb_id;
Ideally, you'd want to sort them by expiration time, but I suppose this may not be trivial.
Also, would this be a good time to ensure that usernames in ipb_address are properly normalized? It seems that at the moment, on enwiki at least, some of the entries contain underscores and some spaces, the choice seeming quite random:
http://en.wikipedia.org/wiki/Special:Ipblocklist?ip=+ http://en.wikipedia.org/wiki/Special:Ipblocklist?ip=_