Page MenuHomePhabricator

RenameUser should allow for more than one operation per table
Open, Needs TriagePublic

Description

In T251277 we think we may have discovered a technical debt in MediaWiki-User-rename: it seems to only allow one set of operations per table.

This would make sense if there exists no table in which two columns correspond to two different user names; most extensions indeed use normalized tables so even if each row references two users (e.g. logging) the table itself only contains the user id for both. The case of CheckUser and its cu_logs table is special, in that the table contains two columns that contain user names (cul_user_text for the performer of the check, and cul_target_text for the target of the check). Other special use cases may exist, or may be introduced in the future.

Therefore, RenameUser should allow using an array of arrays for what is passed to its tables and tablesJob property. This way, the situation with CheckUser could be addressed as such:

$renameUserSQL->tables['cu_log'] = [
  [ 'cul_user_text', 'cul_user' ],
  [ 'cul_target_text', 'cul_target_id' ],
];

Event Timeline

Reedy renamed this task from RenameUser should allow for more than one opertaion per table to RenameUser should allow for more than one operation per table.Apr 28 2020, 6:24 PM