Page MenuHomePhabricator

Add database table information to extjsonuploader
Open, Needs TriagePublic

Description

Some extensions publish their DB schema on mediawiki.org (like this: https://www.mediawiki.org/wiki/Extension:AbuseFilter/abuse_filter_table ). It would be nice to automate that.

This is trickier than extension infoboxes as it is harder to keep the content editable, but maybe we could have a template like

{{ extension table schema
| field1 = af_id
| af_id_description = Primary key
...
}}

with defaults loaded from extjsonuploader data. Or maybe the automatic part could be limited to the schema definition (the part that is currently implemented via pasting the output of the describe command).

Also, the extension infobox lists the database tables, so this could be used there.

On the collection side, this would probably be limited to extensions using abstract schema; we could just scan conventionally-named directories (sql, schema, maintenance, maybe the root) for JSON files and then check for the name, columns and pk fields. Or just wait for T237839: Wire abstract schema and schema changes for extension.