X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=maintenance%2Ftables.sql;h=892f799d5486dd6e8ac6c2faf9281aef15951db9;hb=e2b36bb071cef740ed67debc7c0f327d159d7bdb;hp=03ce508275680740b43a01d7cfbea80759470714;hpb=003e754dce6359c83cc99c693935363c3df81683;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 03ce508275..892f799d54 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -160,11 +160,17 @@ CREATE TABLE /*_*/user_groups ( -- with particular permissions. A user will have the combined -- permissions of any group they're explicitly in, plus -- the implicit '*' and 'user' groups. - ug_group varbinary(255) NOT NULL default '' + ug_group varbinary(255) NOT NULL default '', + + -- Time at which the user group membership will expire. Set to + -- NULL for a non-expiring (infinite) membership. + ug_expiry varbinary(14) NULL default NULL, + + PRIMARY KEY (ug_user, ug_group) ) /*$wgDBTableOptions*/; -CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group); CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group); +CREATE INDEX /*i*/ug_expiry ON /*_*/user_groups (ug_expiry); -- Stores the groups the user has once belonged to. -- The user may still belong to these groups (check user_groups). @@ -676,12 +682,19 @@ CREATE TABLE /*_*/externallinks ( -- which allows for fast searching for all pages under example.com with the -- clause: -- WHERE el_index LIKE 'http://com.example.%' - el_index blob NOT NULL + el_index blob NOT NULL, + + -- This is el_index truncated to 60 bytes to allow for sortable queries that + -- aren't supported by a partial index. + -- @todo Drop the default once this is deployed everywhere and code is populating it. + el_index_60 varbinary(60) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40)); CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from); CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60)); +CREATE INDEX /*i*/el_index_60 ON /*_*/externallinks (el_index_60, el_id); +CREATE INDEX /*i*/el_from_index_60 ON /*_*/externallinks (el_from, el_index_60, el_id); -- -- Track interlanguage links @@ -861,14 +874,14 @@ CREATE TABLE /*_*/image ( img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, -- major part of a MIME media type as defined by IANA - -- see http://www.iana.org/assignments/media-types/ + -- see https://www.iana.org/assignments/media-types/ -- for "chemical" cf. http://dx.doi.org/10.1021/ci9803233 by the ACS img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") NOT NULL default "unknown", -- minor part of a MIME media type as defined by IANA -- the minor parts are not required to adher to any standard -- but should be consistent throughout the database - -- see http://www.iana.org/assignments/media-types/ + -- see https://www.iana.org/assignments/media-types/ img_minor_mime varbinary(100) NOT NULL default "unknown", -- Description field as entered by the uploader.