Problem
The ipblocks table does not use the actor table. Like everywhere in MediaWiki, IP Address should be centralized onto the actor table.
This is somewhat challenging because the table not only stores users and IP addresses, but also IP ranges which are not in the actor table.
Proposed Solution
Deprecate (and later remove) the current target fields:
+----------------------+---------------------+------+-----+----------------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------------+---------------------+------+-----+----------------+----------------+ | ipb_address | tinyblob | NO | MUL | NULL | | | ipb_user | int(10) unsigned | NO | MUL | 0 | | +----------------------+---------------------+------+-----+----------------+----------------+
And add two fields, one as a foreign key to the actor table and another as an int for the range (if the block is a range):
+----------------------+---------------------+------+-----+----------------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------------+---------------------+------+-----+----------------+----------------+ | ipb_actor | bigint(20) unsigned | NO | MUL | 0 | | | ipb_range | int(3) | YES | MUL | NULL | | +----------------------+---------------------+------+-----+----------------+----------------+
When a user submits a range block, an actor will be created for the IP address (if there isn't one already) and the int after the / will be inserted into the ipb_range field. These two fields together will have a UNIQUE key on them to ensure that only a single target has a block.