Manual:watchlist table
↑ Manual:Contents | MediaWiki database layout | watchlist table |
The watchlist table for each registered user contains his or her id and for all the pages the user watches, the namespace number, the page title without namespace, and a notification timestamp, used for page change notification.
Note: MediaWiki works with the assumption that when people watch pages they either watch both the talk page and the normal page, or neither. That means that for each watched page MediaWiki always automatically adds two entries: One for the page and one for its talk page. E.g. when the user watches the Main Page, then there will be two rows in the database table: One for the Main Page in namespace 0 and one for the Main Page in namespace 1 (which is the according talk page). Missing page rows are added by the maintenance script update.php.
Contents
Fields[edit | edit source]
wl_user[edit | edit source]
This is the key to user.user_id.
wl_namespace[edit | edit source]
This is the key to page_namespace.
wl_title[edit | edit source]
This is the key to page_title.
wl_notificationtimestamp[edit | edit source]
MediaWiki version: | ≥ 1.4 |
This is the timestamp when the user was last sent a notification email; it is cleared when the user visits the page.
Schema summary[edit | edit source]
(Current as of v1.23.)
MediaWiki version: | ≥ 1.19 |
"DESCRIBE watchlist;" in version 1.19 gives the following:
mysql> DESCRIBE mw_watchlist; +--------------------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------------+------------------+------+-----+---------+-------+ | wl_user | int(10) unsigned | NO | PRI | NULL | | | wl_namespace | int(11) | NO | PRI | 0 | | | wl_title | varbinary(255) | NO | PRI | | | | wl_notificationtimestamp | varbinary(14) | YES | | NULL | | +--------------------------+------------------+------+-----+---------+-------+ 4 rows in set (0.00 sec)
MediaWiki version: | 1.9 |
mysql> describe watchlist; +--------------------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------------+-----------------+------+-----+---------+-------+ | wl_user | int(5) unsigned | NO | PRI | NULL | | | wl_namespace | int(11) | NO | PRI | 0 | | | wl_title | varchar(255) | NO | PRI | NULL | | | wl_notificationtimestamp | varchar(14) | YES | | NULL | | +--------------------------+-----------------+------+-----+---------+-------+ 4 rows in set (0.01 sec)
MediaWiki version: | 1.8 |
"DESCRIBE watchlist;" in version 1.8 gives the following:
+--------------------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------------+-----------------+------+-----+---------+-------+ | wl_user | int(5) unsigned | NO | PRI | NULL | | | wl_namespace | int(11) | NO | PRI | 0 | | | wl_title | varchar(255) | NO | PRI | NULL | | | wl_notificationtimestamp | varchar(14) | YES | | NULL | | +--------------------------+-----------------+------+-----+---------+-------+
MediaWiki version: | 1.5 |
"DESCRIBE watchlist;" in version 1.5 gives the following:
+--------------------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------------+-----------------+------+-----+---------+-------+ | wl_user | int(5) unsigned | NO | PRI | | | | wl_namespace | int(11) | NO | PRI | 0 | | | wl_title | varchar(255) | NO | PRI | | | | wl_notificationtimestamp | varchar(14) | NO | | 0 | | +--------------------------+-----------------+------+-----+---------+-------+
MediaWiki version: | 1.4 |
"DESCRIBE watchlist;" in version 1.4 gives the following:
+------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+---------------------+------+-----+---------+----------------+ | wl_user | int(5) unsigned | | | | | | wl_namespace | tinyint(2) unsigned | | | 0 | | | wl_title | varchar(255) binary | | | '' | | +------------------+---------------------+------+-----+---------+----------------+
Some of this information was adapted from schema.doc
in the MediaWiki docs/
directory.
![]() |
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 |
---|