mediawiki-extensions-Linter/sql/abstractSchemaChanges/patch-linter-add-namespace.json
sbailey 4544a9c7cc Add namespace column and new index to Linter table - part 1
* This patch contains the code needed to update the database with
   the addition Linter table column linter_namespace <int/null>
   and add an index with category and namespace for faster
   selection of linter records.

Bug: T299612
Change-Id: I05da381b9a74294b44d4aef968614277d601a176
2022-01-28 20:19:38 +00:00

126 lines
3.2 KiB
JSON

{
"comment": "Filter errors by details (T175177)",
"before": {
"name": "linter",
"columns": [
{
"name": "linter_id",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "autoincrement": true }
},
{
"name": "linter_page",
"comment": "page id",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "linter_cat",
"comment": "error category (see CategoryManager::$categoryIds)",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "linter_start",
"comment": "end positions of where the error is located",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "linter_end",
"comment": "end positions of where the error is located",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "linter_params",
"comment": "extra parameters about the error, JSON encoded",
"type": "blob",
"options": { "length": 65530, "notnull": false }
}
],
"indexes": [
{
"name": "linter_page",
"comment": "Query by page",
"columns": [ "linter_page" ],
"unique": false
},
{
"name": "linter_cat_page_position",
"comment": "Unique index for lint errors, also covers linter_cat for query by category",
"columns": [ "linter_cat", "linter_page", "linter_start", "linter_end" ],
"unique": true
}
],
"pk": [ "linter_id" ]
},
"after": {
"name": "linter",
"columns": [
{
"name": "linter_id",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "autoincrement": true }
},
{
"name": "linter_page",
"comment": "page id",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "linter_namespace",
"comment": "page namespace",
"type": "integer",
"options": { "notnull": false, "unsigned": false }
},
{
"name": "linter_cat",
"comment": "error category (see CategoryManager::$categoryIds)",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "linter_start",
"comment": "end positions of where the error is located",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "linter_end",
"comment": "end positions of where the error is located",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "linter_params",
"comment": "extra parameters about the error, JSON encoded",
"type": "blob",
"options": { "length": 65530, "notnull": false }
}
],
"indexes": [
{
"name": "linter_page",
"comment": "Query by page",
"columns": [ "linter_page" ],
"unique": false
},
{
"name": "linter_cat_namespace",
"comment": "Query by category and namespace",
"columns": [ "linter_cat", "linter_namespace" ],
"unique": false
},
{
"name": "linter_cat_page_position",
"comment": "Unique index for lint errors, also covers linter_cat for query by category",
"columns": [ "linter_cat", "linter_page", "linter_start", "linter_end" ],
"unique": true
}
],
"pk": [ "linter_id" ]
}
}