X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Ftables.sql;h=4b9a5e22c12e7ea6cc537f5c14026e31f730ff1d;hb=a30d1c7fe6039e9670bae3e63cf9a0dc6cdbbcf8;hp=1b8d618513a765e14de44a3295734a61bfc8fe9c;hpb=e696a662a96209e642fce66cb861ad18dc5a2371;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 1b8d618513..4b9a5e22c1 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -275,7 +275,10 @@ CREATE TABLE /*_*/page ( page_len int unsigned NOT NULL, -- content model, see CONTENT_MODEL_XXX constants - page_content_model varbinary(32) DEFAULT NULL + page_content_model varbinary(32) DEFAULT NULL, + + -- Page content language + page_lang varbinary(35) DEFAULT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title); @@ -470,6 +473,8 @@ CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id); CREATE TABLE /*_*/pagelinks ( -- Key to the page_id of the page containing the link. pl_from int unsigned NOT NULL default 0, + -- Namespace for this page + pl_from_namespace int 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 @@ -480,7 +485,8 @@ CREATE TABLE /*_*/pagelinks ( ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title); -CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); +CREATE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); +CREATE INDEX /*i*/pl_backlinks_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from_namespace,pl_from); -- @@ -489,6 +495,8 @@ CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,p CREATE TABLE /*_*/templatelinks ( -- Key to the page_id of the page containing the link. tl_from int unsigned NOT NULL default 0, + -- Namespace for this page + tl_from_namespace int 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 @@ -499,7 +507,8 @@ CREATE TABLE /*_*/templatelinks ( ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title); -CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); +CREATE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); +CREATE INDEX /*i*/tl_backlinks_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from_namespace,tl_from); -- @@ -510,6 +519,8 @@ CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_tit CREATE TABLE /*_*/imagelinks ( -- Key to page_id of the page containing the image / media link. il_from int unsigned NOT NULL default 0, + -- Namespace for this page + il_from_namespace int NOT NULL default 0, -- Filename of target image. -- This is also the page_title of the file's description page; @@ -518,7 +529,8 @@ CREATE TABLE /*_*/imagelinks ( ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to); -CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from); +CREATE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from); +CREATE INDEX /*i*/il_backlinks_namespace ON /*_*/imagelinks (il_to,il_from_namespace,il_from); -- @@ -1001,12 +1013,12 @@ CREATE TABLE /*_*/uploadstash ( -- chunk counter starts at 0, current offset is stored in us_size us_chunk_inx int unsigned NULL, - -- Serialized file properties from File::getPropsFromPath + -- Serialized file properties from FSFile::getProps() us_props blob, -- file size in bytes us_size int unsigned NOT NULL, - -- this hash comes from File::sha1Base36(), and is 31 characters + -- this hash comes from FSFile::getSha1Base36(), and is 31 characters us_sha1 varchar(31) NOT NULL, us_mime varchar(255), -- Media type as defined by the MEDIATYPE_xxx constants, should duplicate definition in the image table @@ -1129,6 +1141,7 @@ CREATE TABLE /*_*/watchlist ( CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title); CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title); +CREATE INDEX /*i*/wl_user_notificationtimestamp ON /*_*/watchlist (wl_user, wl_notificationtimestamp); --