Am 12.07.2016 um 21:02 schrieb Rob Lanphier:
On Tue, Jul 12, 2016 at 8:02 AM, Brad Jorsch (Anomie) bjorsch@wikimedia.org wrote:
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.
Could you explain this idea in a way that doesn't require diving into the codebase to figure out what you mean? Cloaking the mapping of local ids (e.g. auto incremented in the DB) to global ids ("model names") seems to suggest a new way of making our system behave in an inscrutable way.
The idea is that in API responses (and requests), in XML dumps, etc, the content model for wikitext will be represented as the string "wikitext", even if the internal ID is 1 in the database of one wiki, and 37 on another. Clients have to know the canonical names, they are not concerned with the internal ids. They are considered an internal optimization, an implementation detail.