Why: * Part of a temporary user name is generated from an index that increments, which is stored in the database. * As specified in T345855, the index will be restarted each year. * Also specified in T345855, the year will be included in generated temporary user names. What: * Since the year must be included in the name in order to avoid naming conflicts if the index is restarted each year, both are implemented together and controlled by a single config. * Add a new config option that, when true, restarts the name generation index at the start of each year and add the year into the user name: $wgAutoCreateTempUser['serialProvider']['useYear'] * Add a uas_year column to the user_autocreate_serial table, which is unique in combination with uas_shard, so the index can be stored for each shard/year combination. * The year is added into the username just after the prefix, as specified in T345855. This is based on research that having the year near the start of the name aids understanding that the names are not IP addresses. The position of the year within the name is therefore not configurable (though whether to include it is). See T345855 for the research. Bug: T349494 Bug: T349501 Depends-On: I6b3c640a4e74f52fd4a4f46de5a2cbe80fe3b665 Change-Id: If51acb3f4efa361ce36d919c862a52501a5a7d24
9 lines
489 B
SQL
9 lines
489 B
SQL
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
|
|
-- Source: maintenance/abstractSchemaChanges/patch-user_autocreate_serial-uas_year.json
|
|
-- Do not modify this file directly.
|
|
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
|
|
DROP INDEX `primary` ON /*_*/user_autocreate_serial;
|
|
ALTER TABLE /*_*/user_autocreate_serial
|
|
ADD uas_year SMALLINT UNSIGNED NOT NULL;
|
|
ALTER TABLE /*_*/user_autocreate_serial
|
|
ADD PRIMARY KEY (uas_shard, uas_year);
|