On Tue, Jul 12, 2016 at 4:40 AM, Daniel Kinzler <daniel.kinz...@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/PageAssessmentsBody.php;c7b21e97f650face3a257ab70763a5abad420992$41-44

>
> 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?


-- 
Brad Jorsch (Anomie)
Senior Software Engineer
Wikimedia Foundation
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to