Manual:links table

From Linux Web Expert

Revision as of 19:38, 11 February 2022 by imported>Shirayuki (Marked this version for translation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Manual:Contents <translate> MediaWiki database layout</translate> <translate> <tvar name=1>links</tvar> table</translate>
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.3</tvar> is unsupported version</translate>">
1.1 – 1.3
<translate> MediaWiki versions:</translate>
The links and brokenlinks tables have been merged to a single pagelinks table, which records the namespace+title key pair of target links rather than the page ID or the prefixed title. See [1]

The links table stored all the links to existing articles. This was good for a variety of functions, from link caching in the output functions to the "what links here" page. It was the "good twin" of the brokenlinks table.

Beginning with the MediaWiki 1.5 release this table is not used, and can be safely deleted. The contents have been migrated to the table pagelinks on update. Regenerating the pagelinks table always is possible using the rebuildall maintenance script.

Fields

l_from

l_from is the cur_id of the article that contains the link. (This is a change from 1.2, wherein the title of the article was stored. This was not very wise, and has now been fixed.)

l_to

l_to is the cur_id of the "target" article.

Schema summary

<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.3</tvar> is unsupported version</translate>">
1.3
MediaWiki version:
+--------+-----------------+------+-----+---------+-------+
| Field  | Type            | Null | Key | Default | Extra |
+--------+-----------------+------+-----+---------+-------+
| l_from | int(8) unsigned | NO   | PRI | 0       |       |
| l_to   | int(8) unsigned | NO   | PRI | 0       |       |
+--------+-----------------+------+-----+---------+-------+
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.2</tvar> is unsupported version</translate>">
1.2
MediaWiki version:
+--------+-----------------+------+-----+---------+-------+
| Field  | Type            | Null | Key | Default | Extra |
+--------+-----------------+------+-----+---------+-------+
| l_from | varchar(255)    | NO   | PRI |         |       |
| l_to   | int(8) unsigned | NO   | PRI | 0       |       |
+--------+-----------------+------+-----+---------+-------+
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.1</tvar> is unsupported version</translate>">
1.1
MediaWiki version:
+--------+-----------------+------+-----+---------+-------+
| Field  | Type            | Null | Key | Default | Extra |
+--------+-----------------+------+-----+---------+-------+
| l_from | varchar(255)    | NO   |     |         |       |
| l_to   | int(8) unsigned | NO   |     | 0       |       |
+--------+-----------------+------+-----+---------+-------+

Indexes

<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.3</tvar> is unsupported version</translate>">
1.3
MediaWiki version:

SHOW INDEX IN links;

+--------+-----------------+------+-----+---------+-------+
| Field  | Type            | Null | Key | Default | Extra |
+--------+-----------------+------+-----+---------+-------+
| l_from | int(8) unsigned | NO   | PRI | 0       |       |
| l_to   | int(8) unsigned | NO   | PRI | 0       |       |
+--------+-----------------+------+-----+---------+-------+