patch-pagelinks.sql

来自「php 开发的内容管理系统」· SQL 代码 · 共 57 行

SQL
57
字号
---- Create the new pagelinks table to merge links and brokenlinks data,-- and populate it.-- -- Unlike the old links and brokenlinks, these records will not need to be-- altered when target pages are created, deleted, or renamed. This should-- reduce the amount of severe database frustration that happens when widely--- linked pages are altered.---- Fixups for brokenlinks to pages in namespaces need to be run after this;-- this is done by updaters.inc if run through the regular update scripts.---- 2005-05-26------ Track page-to-page hyperlinks within the wiki.--CREATE TABLE /*$wgDBprefix*/pagelinks (  -- Key to the page_id of the page containing the link.  pl_from int(8) unsigned NOT NULL default '0',    -- Key to page_namespace/page_title of the target page.  -- The target page may or may not exist, and due to renames  -- and deletions may refer to different page records as time  -- goes by.  pl_namespace int NOT NULL default '0',  pl_title varchar(255) binary NOT NULL default '',    UNIQUE KEY pl_from(pl_from,pl_namespace,pl_title),  KEY (pl_namespace,pl_title)) TYPE=InnoDB;-- Import existing-page linksINSERT  INTO /*$wgDBprefix*/pagelinks (pl_from,pl_namespace,pl_title)  SELECT l_from,page_namespace,page_title    FROM /*$wgDBprefix*/links, /*$wgDBprefix*/page    WHERE l_to=page_id;-- import brokenlinks-- NOTE: We'll have to fix up individual entries that aren't in main NSINSERT INTO /*$wgDBprefix*/pagelinks (pl_from,pl_namespace,pl_title)  SELECT bl_from, 0, bl_to  FROM /*$wgDBprefix*/brokenlinks;-- For each namespace do something like:---- UPDATE /*$wgDBprefix*/pagelinks--   SET pl_namespace=$ns,--       pl_title=TRIM(LEADING '$prefix:' FROM pl_title)-- WHERE pl_namespace=0--   AND pl_title LIKE '$likeprefix:%'";--

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?