Jump to content

User:RichMorin/mw watchlist

From Meta, a Wikimedia project coordination wiki

Contains watchlist information.


Inter-table Relationships

[edit]
  • wl_namespace - page namespace ( page.page_namespace)
  • wl_title - page title ( page.page_title)
  • wl_user - user ID ( user.user_id)


MySQL Table Description

[edit]
mysql> desc mw_watchlist;
+--------------------------+-----------------+------+-----+---------+-------+
| Field                    | Type            | Null | Key | Default | Extra |
+--------------------------+-----------------+------+-----+---------+-------+
| wl_user                  | int(5) unsigned |      | PRI | 0       |       |
| wl_namespace             | int(11)         |      | PRI | 0       |       |
| wl_title                 | varchar(255)    |      | PRI |         |       |
| wl_notificationtimestamp | varchar(14)     |      |     | 0       |       |
+--------------------------+-----------------+------+-----+---------+-------+
4 rows in set


Annotated Table Creation Code

[edit]
CREATE TABLE /*$wgDBprefix*/watchlist (

  -- Key to user.user_id

  wl_user             int(5)         unsigned     NOT NULL,
  
  -- Key to page_namespace/page_title.
  -- Note that users may watch patches which do not exist yet,
  -- or which existed in the past but have been deleted.

  wl_namespace        int                         NOT NULL  default '0',
  wl_title            varchar(255)   binary       NOT NULL  default '',
  
  -- Timestamp when user was last sent a notification e-mail;
  -- cleared when the user visits the page.

  wl_notificationtimestamp  varchar(14)  binary   NOT NULL  default '0',
  
UNIQUE KEY            (wl_user, wl_namespace, wl_title),
KEY                   namespace_title (wl_namespace, wl_title)

) ENGINE=InnoDB;