Manual:category table
↑ Manual:Contents | MediaWiki database layout | category table |
MediaWiki version: | ≥ 1.13 |
Track all existing categories. Something is a category if
- it has an entry somewhere in categorylinks, or
- it once did.
Categories might not have corresponding pages, so they need to be tracked separately. cat_pages, cat_subcats, and cat_files are signed to make underflow more obvious.
Note: The pages and sub-categories are stored in the categorylinks table.
Note: Information regarding which categories are hidden is stored in the page_props table.
Note: The number fields are signed to make underflow more obvious. We make the first number include the second two for better sorting: subtracting for display is easy, adding for ordering is not.
Note: If the information in this table is incorrect, run the maintenance script populateCategory.php, if neccessary with the --force option.
Fields[edit | edit source]
cat_id[edit | edit source]
Primary key
cat_title[edit | edit source]
Name of the category, in the same form as page.page_title (with underscores). If there is a category page corresponding to this category, by definition, it has this name (in the Category namespace).
cat_pages[edit | edit source]
Number of pages in the category. This number includes the number of subcategories and the number of files.
cat_subcats[edit | edit source]
Number of sub-categories in the category.
cat_files[edit | edit source]
Number of files (i.e. Image: namespace members) in the category.
[edit | edit source]
MediaWiki version: | ≤ 1.19 |
Was reserved for future use; apparently no one found a use for it because it was removed in v1.20. Instead, the status of hidden categories is stored in the page props table as the property "hiddencat" in pp_propname
.
Schema[edit | edit source]
MediaWiki version: | 1.20 |
mysql> describe category; +-------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+------------------+------+-----+---------+----------------+ | cat_id | int(10) unsigned | NO | PRI | NULL | auto_increment | | cat_title | varbinary(255) | NO | UNI | NULL | | | cat_pages | int(11) | NO | MUL | 0 | | | cat_subcats | int(11) | NO | | 0 | | | cat_files | int(11) | NO | | 0 | | +-------------+------------------+------+-----+---------+----------------+ 5 rows in set (0.00 sec)
MediaWiki version: | 1.19 |
mysql> describe category; +-------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------------------+------+-----+---------+----------------+ | cat_id | int(10) unsigned | NO | PRI | NULL | auto_increment | | cat_title | varbinary(255) | NO | UNI | NULL | | | cat_pages | int(11) | NO | MUL | 0 | | | cat_subcats | int(11) | NO | | 0 | | | cat_files | int(11) | NO | | 0 | | | cat_hidden | tinyint(3) unsigned | NO | | 0 | | +-------------+---------------------+------+-----+---------+----------------+
MediaWiki version: | 1.14 |
MediaWiki version: | 1.13 |
+-------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------------------+------+-----+---------+----------------+ | cat_id | int(10) unsigned | | PRI | NULL | auto_increment | | cat_title | varbinary(255) | | UNI | | | | cat_pages | int(11) | | MUL | 0 | | | cat_subcats | int(11) | | | 0 | | | cat_files | int(11) | | | 0 | | | cat_hidden | tinyint(3) unsigned | | | 0 | | +-------------+---------------------+------+-----+---------+----------------+
![]() |
Engines: MySQL – Oracle – PostgreSQL – SQLite Technical documentation: Schema (tables) – API property associations – Field prefixes – Primary key storage in other fields – Wikimedia extension tables Configuration: Settings – Sharing Development: Access – Optimization – Policy – Updater – Extension schema updates – Patch file Core tables: archive – category – categorylinks – change_tag – config – externallinks – filearchive – hitcounter – image – imagelinks – interwiki – iwlinks – ipblocks – job – l10n_cache – langlinks – logging – log_search – msg_resource – msg_resource_links – module_deps – objectcache – oldimage – page – pagelinks – page_props – page_restrictions – protected_titles – querycache – querycachetwo – querycache_info – recentchanges – redirect – revision – searchindex – sites – site_stats – tag_summary – templatelinks – text – transcache – updatelog – uploadstash – user – user_former_groups – user_groups – user_newtalk – user_properties – valid_tag – watchlist |
---|
Language: | English • polski |
---|