mediawiki-extensions-Linter/linter.sql
Kunal Mehta b41e74ce8b Hardcode category ids
Instead of having a complex auto-increment category manager that had
additional caching, just hardcode the (currently 6) ids for each
category, which allows us to simplify a lot of code.

If Parsoid sends a lint error in a category that we don't know about, it
is silently dropped.

Bug: T151287
Change-Id: Ice6edf1b7985390aa0c1c410d357bc565bb69108
2016-11-22 18:31:17 -08:00

16 lines
504 B
SQL

CREATE TABLE /*_*/linter (
-- primary key
linter_id int UNSIGNED PRIMARY KEY not null AUTO_INCREMENT,
-- page id
linter_page int UNSIGNED not null,
-- error category (see CategoryManager::$categoryIds)
linter_cat int UNSIGNED not null,
-- extra parameters about the error, JSON encoded
linter_params blob NOT NULL
) /*$wgDBTableOptions*/;
-- Query by page
CREATE INDEX /*i*/linter_page ON /*_*/linter (linter_page);
-- Query by category
CREATE INDEX /*i*/linter_cat ON /*_*/linter (linter_cat);