User:RichMorin/mw imagelinks

From Meta, a Wikimedia project coordination wiki

Track links to images used inline. We don't distinguish live from broken links here, so they do not need to be changed on upload / removal.


Inter-table Relationships[edit]

  • il_from - page ID ( page.page_id)


MySQL Table Description[edit]

mysql> desc mw_imagelinks;
+---------+-----------------+------+-----+---------+-------+
| Field   | Type            | Null | Key | Default | Extra |
+---------+-----------------+------+-----+---------+-------+
| il_from | int(8) unsigned |      | PRI | 0       |       |
| il_to   | varchar(255)    |      | PRI |         |       |
+---------+-----------------+------+-----+---------+-------+
2 rows in set


Annotated Table Creation Code[edit]

-- Track links to images *used inline*
-- We don't distinguish live from broken links here, so
-- they do not need to be changed on upload/removal.

CREATE TABLE /*$wgDBprefix*/imagelinks (

  -- Key to page_id of the page containing the image / media link.

  il_from int(8)      unsigned                    NOT NULL  default '0',
  
  -- Filename of target image.
  -- This is also the page_title of the file's description page;
  -- all such pages are in namespace 6 (NS_IMAGE).

  il_to               varchar(255)   binary       NOT NULL  default '',
  
  UNIQUE KEY          il_from(il_from, il_to),

  KEY                 (il_to)

) ENGINE=InnoDB;