| daniel updated the task description. (Show Details) |
CHANGES TO TASK DESCRIPTION
----
== Migrating Tools to the New Schema ==
Tools that need to know the content model of a revision's content can look it up using the new `slots` and `content` tables, which are already available on labs, but not yet populated. Populating these tables is part of {T183488}. Once this is done, the following query returns the content models of a revision's slots:
SELECT slot_role_id, content_model FROM slots JOIN content ON slot_content_id = content_id WHERE slot_revision_id = 12345.
Note that this will return multiple rows if the revision has multiple slots. See https://www.mediawiki.org/wiki/Multi-Content_Revisions/Database_Schema for reference.
The meaning of slot_role_id can be looked up in the `slot_roles`table, the meaning of content_model can be looked up in `content_models`. This could be done with a join, but it may be more sensible to do this programmatically. This mapping never changes and only very rarely grows, so it can be cached aggressively.
NOTE: rev_content_format and rev_text_id are only relevant when loading serialized blobs from external storage, which is not possible on toolforge. They are removed without replacement.
...
NOTE: this ticket originally asked for compatibility to be maintained by adding joins to the views for the page and revision table. This idea has been dropped due to performance issues, see T195515.----
== Migrating Tools to the New Schema ==
Tools that need to know the content model of a revision's content can look it up using the new `slots` and `content` tables, which are already available on labs, but not yet populated. Populating these tables is part of {T183488}. Once this is done, the following query returns the content models of a revision's slots:
SELECT slot_role_id, content_model FROM slots JOIN content ON slot_content_id = content_id WHERE slot_revision_id = 12345.
Note that this will return multiple rows if the revision has multiple slots. See https://www.mediawiki.org/wiki/Multi-Content_Revisions/Database_Schema for reference.
The meaning of slot_role_id can be looked up in the `slot_roles`table, the meaning of content_model can be looked up in `content_models`. This could be done with a join, but it may be more sensible to do this programmatically. This mapping never changes and only very rarely grows, so it can be cached aggressively.
NOTE: rev_content_format and rev_text_id are only relevant when loading serialized blobs from external storage, which is not possible on toolforge. They are removed without replacement.
TASK DETAIL
EMAIL PREFERENCES
To: daniel
Cc: Stashbot, jcrespo, gerritbot, Bstorm, Tgr, bd808, Anomie, Aklapper, daniel, AndyTan, Zylc, 1978Gage2001, Lahi, Gq86, GoranSMilovanovic, Chicocvenancio, QZanden, Tbscho, LawExplorer, JJMC89, Agabi10, srodlund, Wikidata-bugs, aude, Gryllida, scfc, Mbch331, Ltrlg, Krenair, chasemp
Cc: Stashbot, jcrespo, gerritbot, Bstorm, Tgr, bd808, Anomie, Aklapper, daniel, AndyTan, Zylc, 1978Gage2001, Lahi, Gq86, GoranSMilovanovic, Chicocvenancio, QZanden, Tbscho, LawExplorer, JJMC89, Agabi10, srodlund, Wikidata-bugs, aude, Gryllida, scfc, Mbch331, Ltrlg, Krenair, chasemp
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
