Difference between revisions of "MediaWiki/tables"
Jump to navigation
Jump to search
(should work) |
(some keys) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==page_props== | ==page_props== | ||
− | Stores "page properties". I'm not quite sure how this is ''supposed'' to be used, | + | Stores "page properties". I'm not quite sure how this is ''supposed'' to be used, but I've noticed some keys that are often present: |
+ | * <code>notoc</code> presumably flags that the <nowiki>__NOTOC__</nowiki> indicator is present in the page's content | ||
+ | * <code>noeditsection</code> presumably flags that the <nowiki>__NOEDITSECTION</nowiki> indicator is present in the page's content | ||
+ | * <code>smw-semanticdata-status</code> presumably flags that there are [[Semantic MediaWiki]] tags in the page's content | ||
Names and values are kept in binary blobs, though (even though they are strings), so you have to do a modified query to see what's going on: | Names and values are kept in binary blobs, though (even though they are strings), so you have to do a modified query to see what's going on: | ||
<syntaxhighlight lang=mysql>SELECT pp_page, CAST(pp_propname AS CHAR) AS Name, CAST(pp_value AS CHAR) AS Value, pp_sortkey FROM page_props;</syntaxhighlight> | <syntaxhighlight lang=mysql>SELECT pp_page, CAST(pp_propname AS CHAR) AS Name, CAST(pp_value AS CHAR) AS Value, pp_sortkey FROM page_props;</syntaxhighlight> | ||
+ | A slightly more complex query to show the names of the pages (instead of just IDs): | ||
+ | <syntaxhighlight lang=mysql>SELECT | ||
+ | pp_page, | ||
+ | page_namespace, | ||
+ | page_title, | ||
+ | CAST(pp_propname AS CHAR) AS Name, | ||
+ | CAST(pp_value AS CHAR) AS Value, | ||
+ | pp_sortkey | ||
+ | FROM | ||
+ | page_props | ||
+ | LEFT JOIN | ||
+ | page ON pp_page = page_id | ||
+ | </syntaxhighlight> |
Latest revision as of 15:49, 22 February 2018
page_props
Stores "page properties". I'm not quite sure how this is supposed to be used, but I've noticed some keys that are often present:
notoc
presumably flags that the __NOTOC__ indicator is present in the page's contentnoeditsection
presumably flags that the __NOEDITSECTION indicator is present in the page's contentsmw-semanticdata-status
presumably flags that there are Semantic MediaWiki tags in the page's content
Names and values are kept in binary blobs, though (even though they are strings), so you have to do a modified query to see what's going on:
SELECT pp_page, CAST(pp_propname AS CHAR) AS Name, CAST(pp_value AS CHAR) AS Value, pp_sortkey FROM page_props;
A slightly more complex query to show the names of the pages (instead of just IDs):
SELECT
pp_page,
page_namespace,
page_title,
CAST(pp_propname AS CHAR) AS Name,
CAST(pp_value AS CHAR) AS Value,
pp_sortkey
FROM
page_props
LEFT JOIN
page ON pp_page = page_id