Extension:MediaModeration/mediamoderation scan table

MediaWiki version:
1.42

This table is used by Extension:MediaModeration to store the status of scans for images on a wiki.

This database table may be stored on an External Store, and on WMF wikis is stored on extension1.

Fields

edit

mms_sha1

edit

SHA-1 content hash of the image in base-36, used as the primary key. This column is foreign key to img_sha1 , oi_sha1 , and fa_sha1 in the image , oldimage , and filearchive tables respectively.

One mms_sha1 value may reference multiple rows in the image , oldimage , filearchive tables.

mms_last_checked

edit

Date in integer form of YYYYMMDD of the last check for the image(s) with this SHA-1 against PhotoDNA. This value is updated to the current date when scanning, even when scanning failed and no request was sent to PhotoDNA. This is done so that the scanning script does not attempt to scan the same SHA-1 multiple times.

mms_is_match

edit

Whether the image(s) with this SHA-1 are a match against PhotoDNA. The value of 1 indicates a match, 0 indicates a negative match, and NULL indicates no scan has been performed/the scans performed have all failed.

Schema

edit

DESCRIBE mediamoderation_scan;

+------------------+---------------------+------+-----+---------+-------+
| Field            | Type                | Null | Key | Default | Extra |
+------------------+---------------------+------+-----+---------+-------+
| mms_sha1         | varbinary(32)       | NO   | PRI | NULL    |       |
| mms_last_checked | int(10) unsigned    | YES  | MUL | NULL    |       |
| mms_is_match     | tinyint(1) unsigned | YES  | MUL | NULL    |       |
+------------------+---------------------+------+-----+---------+-------+

Indexes

edit

SHOW INDEX IN mediamoderation_scan;

+----------------------+------------+---------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| Table                | Non_unique | Key_name                  | Seq_in_index | Column_name      | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
+----------------------+------------+---------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| mediamoderation_scan |          0 | PRIMARY                   |            1 | mms_sha1         | A         | 0           |     NULL | NULL   |      | BTREE      |         |               | NO      |
| mediamoderation_scan |          1 | mms_is_match_last_checked |            1 | mms_is_match     | A         | 0           |     NULL | NULL   | YES  | BTREE      |         |               | NO      |
| mediamoderation_scan |          1 | mms_is_match_last_checked |            2 | mms_last_checked | A         | 0           |     NULL | NULL   | YES  | BTREE      |         |               | NO      |
| mediamoderation_scan |          1 | mms_last_checked          |            1 | mms_last_checked | A         | 0           |     NULL | NULL   | YES  | BTREE      |         |               | NO      |
+----------------------+------------+---------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+