On Tue, Jul 12, 2016 at 4:40 AM, Daniel Kinzler <daniel.kinzler@wikimedia.de
wrote:
Do we really want to manage something that is essentially configuration, namely the set of available content models and formats, in a database table? How is it maintained?
One simple method: assign the numeric IDs by making the numeric ID column auto-increment, and insert the model strings into the table as needed. PageAssessments uses this model for tracking its project tags.[1]
The disadvantage is that there wouldn't be any cross-wiki mapping between model names and ids, which can be mitigated somewhat by never exposing the ids externally.
[1]: https://phabricator.wikimedia.org/diffusion/EPAS/browse/master/PageAssessmen...
Such a mapping could be maintain in LocalSettings.php, just like we do for namespaces. This would also serve to avoid ID clashes. My idea back then was to have a sort of registry on mediawiki.org where extensions could reserve an ID for themselves, so that the same ID would stand for the same model everywhere.
Does the registry idea work all that smoothly for namespaces, though?