Page MenuHomePhabricator

Suggested investigations: Make sic_url_identifier index unique and remove default on the sic_url_identifier column in cusi_case
Closed, ResolvedPublic

Description

Summary

Once we have populated the sic_url_identifier for cusi_case rows, we should remove the default on the column and make the index unique per T409316: Add a column to cusi_case for a URL identifier.

Background

Proposed schema

Per T409316: Add a column to cusi_case for a URL identifier, alter cusi_case table to be the following:

> describe cusi_case;
+-----------------------+---------------------+------+-----+---------+----------------+
| Field                 | Type                | Null | Key | Default | Extra          |
+-----------------------+---------------------+------+-----+---------+----------------+
| sic_id                | int(10) unsigned    | NO   | PRI | NULL    | auto_increment |
| sic_status            | tinyint(3) unsigned | NO   | MUL | 0       |                |
| sic_status_reason     | varbinary(255)      | NO   |     |         |                |
| sic_created_timestamp | binary(14)          | NO   | MUL | NULL    |                |
| sic_url_identifier    | int(10) unsigned    | NO   | UNI | NULL    |                |
+-----------------------+---------------------+------+-----+---------+----------------+
> show indexes from cusi_case;
+-----------+------------+---------------------------------+--------------+-----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| Table     | Non_unique | Key_name                        | Seq_in_index | Column_name           | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
+-----------+------------+---------------------------------+--------------+-----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
...
| cusi_case |          0 | sic_url_identifier              |            1 | sic_url_identifier    | A         |           1 |     NULL | NULL   |      | BTREE      |         |               | NO      |
+-----------+------------+---------------------------------+--------------+-----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+

Acceptance criteria

Event Timeline

Change #1206389 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Make sic_url_identifier in cusi_case

https://gerrit.wikimedia.org/r/1206389

Change #1207156 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Run populateSicIdentifier.php during schema updates in update.php

https://gerrit.wikimedia.org/r/1207156

Change #1207156 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Run populateSicIdentifier.php during schema updates in update.php

https://gerrit.wikimedia.org/r/1207156

Change #1207274 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Don't return false from PopulateSicUrlIdentifier::doDBUpdates

https://gerrit.wikimedia.org/r/1207274

Change #1207274 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Don't return false from PopulateSicUrlIdentifier::doDBUpdates

https://gerrit.wikimedia.org/r/1207274

Change #1206389 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Make sic_url_identifier unique in cusi_case

https://gerrit.wikimedia.org/r/1206389

hector.arroyo subscribed.

Moving this to QA in the team's board given that all patches have been merged and it is already in QA in the WE4.2 board