Currently, it's like this:
CREATE TABLE /*$wgDBprefix*/abuse_filter_action ( afa_filter BIGINT unsigned NOT NULL, afa_consequence varchar(255) NOT NULL, afa_parameters TINYBLOB NOT NULL, PRIMARY KEY (afa_filter,afa_consequence), KEY (afa_consequence) ) /*$wgDBTableOptions*/;
The PK and indexes are defined inside CREATE TABLE statement. This is explicitly against coding convention of database ("Create indices as separate statements, do not include them in the table creation query; the separate syntax is clearer and makes it easier to see the difference between unique and non-unique indices. Don't create indices with ALTER TABLE ... ADD INDEX ..., always use CREATE INDEX ... ON ... instead. ") and has been causing lots of issues:
- It doesn't work in Sqlite, so the extension has a separate file just for sqlite meaning more DB schema to maintain
- Not having explicit names for the indexes is making checking the drifts pretty hard (T104459: Detect object, schema and data drifts between mediawiki HEAD, production masters and replicas)
- The name MySQL is automatically giving to the indexes is different from the name sqlite uses causing the drift report (that's based on the Sqlite schema) have more than 1500 drifts. To compare, core with many many more tables has half of these drifts