Index: branches/iwtransclusion/phase3v3/maintenance/tables.sql |
— | — | @@ -1479,4 +1479,68 @@ |
1480 | 1480 | -- Should cover *most* configuration - strings, ints, bools, etc. |
1481 | 1481 | CREATE INDEX /*i*/cf_name_value ON /*_*/config (cf_name,cf_value(255)); |
1482 | 1482 | |
| 1483 | +-- Table tracking interwiki transclusions in the spirit of templatelinks. |
| 1484 | +-- This table tracks transclusions of this wiki's templates on another wiki |
| 1485 | +-- The gtl_from_* fields describe the (remote) page the template is transcluded from |
| 1486 | +-- The gtl_to_* fields describe the (local) template being transcluded |
| 1487 | +CREATE TABLE /*_*/globaltemplatelinks ( |
| 1488 | + -- The wiki ID of the remote wiki |
| 1489 | + gtl_from_wiki varchar(64) NOT NULL, |
| 1490 | + |
| 1491 | + -- The page ID of the calling page on the remote wiki |
| 1492 | + gtl_from_page int unsigned NOT NULL, |
| 1493 | + |
| 1494 | + -- The namespace of the calling page on the remote wiki |
| 1495 | + -- Needed for display purposes, since the foreign namespace ID doesn't necessarily match a local one |
| 1496 | + -- The link between the namespace and the namespace name is made by the globalnamespaces table |
| 1497 | + gtl_from_namespace int NOT NULL, |
| 1498 | + |
| 1499 | + -- The title of the calling page on the remote wiki |
| 1500 | + -- Needed for display purposes |
| 1501 | + gtl_from_title varchar(255) binary NOT NULL, |
| 1502 | + |
| 1503 | + -- The interwiki prefix of the wiki that hosts the transcluded page |
| 1504 | + gtl_to_prefix varchar(32) NOT NULL, |
| 1505 | + |
| 1506 | + -- The namespace of the transcluded page on that wiki |
| 1507 | + gtl_to_namespace int NOT NULL, |
| 1508 | + |
| 1509 | + -- The namespace name of transcluded page |
| 1510 | + -- Needed for display purposes, since the local namespace ID doesn't necessarily match a distant one |
| 1511 | + gtl_to_namespacetext varchar(255) NOT NULL, |
| 1512 | + |
| 1513 | + -- The title of the transcluded page on that wiki |
| 1514 | + gtl_to_title varchar(255) binary NOT NULL |
| 1515 | +) /*$wgDBTableOptions*/; |
| 1516 | + |
| 1517 | +CREATE UNIQUE INDEX /*i*/gtl_to_from ON /*_*/globaltemplatelinks (gtl_to_prefix, gtl_to_namespace, gtl_to_title, gtl_from_wiki, gtl_from_page); |
| 1518 | +CREATE UNIQUE INDEX /*i*/gtl_from_to ON /*_*/globaltemplatelinks (gtl_from_wiki, gtl_from_page, gtl_to_prefix, gtl_to_namespace, gtl_to_title); |
| 1519 | + |
| 1520 | +-- Table listing distant wiki namespace texts. |
| 1521 | +CREATE TABLE /*_*/globalnamespaces ( |
| 1522 | + -- The wiki ID of the remote wiki |
| 1523 | + gn_wiki varchar(64) NOT NULL, |
| 1524 | + |
| 1525 | + -- The namespace ID of the transcluded page on that wiki |
| 1526 | + gn_namespace int NOT NULL, |
| 1527 | + |
| 1528 | + -- The namespace text of transcluded page |
| 1529 | + -- Needed for display purposes, since the local namespace ID doesn't necessarily match a distant one |
| 1530 | + gn_namespacetext varchar(255) NOT NULL |
| 1531 | + |
| 1532 | +) /*$wgDBTableOptions*/; |
| 1533 | +CREATE UNIQUE INDEX /*i*/gn_index ON /*_*/globalnamespaces (gn_wiki, gn_namespace, gn_namespacetext); |
| 1534 | + |
| 1535 | +-- Table associating distant wiki IDs with their interwiki prefixes. |
| 1536 | +CREATE TABLE /*_*/globalinterwiki ( |
| 1537 | + -- The wiki ID of the wiki |
| 1538 | + giw_wikiid varchar(64) NOT NULL, |
| 1539 | + |
| 1540 | + -- The interwiki prefix of that wiki |
| 1541 | + giw_prefix varchar(32) NOT NULL |
| 1542 | + |
| 1543 | +) /*$wgDBTableOptions*/; |
| 1544 | +CREATE UNIQUE INDEX /*i*/giw_index ON /*_*/globalinterwiki (giw_wikiid, giw_prefix); |
| 1545 | + |
| 1546 | + |
1483 | 1547 | -- vim: sw=2 sts=2 et |
Index: branches/iwtransclusion/phase3v3/includes/installer/MysqlUpdater.php |
— | — | @@ -183,6 +183,11 @@ |
184 | 184 | array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ), |
185 | 185 | array( 'addTable', 'config', 'patch-config.sql' ), |
186 | 186 | array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ), |
| 187 | + |
| 188 | + // 1.19 |
| 189 | + array( 'addTable', 'globaltemplatelinks', 'patch-globaltemplatelinks.sql' ), |
| 190 | + array( 'addTable', 'globalnamespaces', 'patch-globalnamespaces.sql' ), |
| 191 | + array( 'addTable', 'globalinterwiki', 'patch-globalinterwiki.sql' ), |
187 | 192 | ); |
188 | 193 | } |
189 | 194 | |