Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/190660

Change subject: Update sql
......................................................................

Update sql

* Update seperate sql files to match changes in centralauth.sql.

* Convert spaces to tabs in sql files.

* Some changes for sqlite.

Change-Id: I13bc6a821863fbbd403d3823d4445eb1292e3f67
---
M central-auth.sql
M db_patches/patch-globalgroups.sql
M db_patches/patch-globaluser_gu_authtoken.sql
M db_patches/patch-gu_hidden.sql
M db_patches/patch-lu_wiki.sql
M db_patches/patch-renameuser.sql
M db_patches/patch-requestrename-fix-wiki.sql
M db_patches/patch-requestrename.sql
M db_patches/patch-users_to_rename.sql
M db_patches/patch-wikisets.sql
10 files changed, 187 insertions(+), 189 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/60/190660/1

diff --git a/central-auth.sql b/central-auth.sql
index 1438386..0284aff 100644
--- a/central-auth.sql
+++ b/central-auth.sql
@@ -14,8 +14,7 @@
 -- the localnames table.
 --
 CREATE TABLE /*_*/globalnames (
-  gn_name varchar(255) binary not null,
-  primary key (gn_name)
+       gn_name varchar(255) binary not null PRIMARY KEY AUTO_INCREMENT,
 ) /*$wgDBTableOptions*/;
 
 --
@@ -30,10 +29,10 @@
 -- only existing databases not yet migrated have to be loaded.
 --
 CREATE TABLE /*_*/localnames (
-  ln_wiki varchar(255) binary not null,
-  ln_name varchar(255) binary not null,
+       ln_wiki varchar(255) binary not null,
+       ln_name varchar(255) binary not null,
 
-  primary key (ln_wiki, ln_name)
+       PRIMARY KEY (ln_wiki, ln_name)
 ) /*$wgDBTableOptions*/;
 
 CREATE INDEX /*i*/ln_name_wiki ON /*_*/localnames (ln_name, ln_wiki);
@@ -42,50 +41,50 @@
 -- Global account data.
 --
 CREATE TABLE /*_*/globaluser (
-  -- Internal unique ID for the authentication server
-  gu_id int primary key auto_increment,
+       -- Internal unique ID for the authentication server
+       gu_id int PRIMARY KEY AUTO_INCREMENT,
 
-  -- Username.
-  gu_name varchar(255) binary,
+       -- Username.
+       gu_name varchar(255) binary,
 
-  -- Timestamp and method used to create the global account
-  gu_enabled varchar(14) not null default '',
-  gu_enabled_method enum('opt-in', 'batch', 'auto', 'admin') default null,
+       -- Timestamp and method used to create the global account
+       gu_enabled varchar(14) not null default '',
+       gu_enabled_method enum('opt-in', 'batch', 'auto', 'admin') default null,
 
-  -- Local database name of the user's 'home' wiki.
-  -- By default, the 'winner' of a migration check for old accounts
-  -- or the account the user was first registered at for new ones.
-  -- May be changed over time.
-  gu_home_db varchar(255) binary,
+       -- Local database name of the user's 'home' wiki.
+       -- By default, the 'winner' of a migration check for old accounts
+       -- or the account the user was first registered at for new ones.
+       -- May be changed over time.
+       gu_home_db varchar(255) binary,
 
-  -- Registered email address, may be empty.
-  gu_email varchar(255) binary,
+       -- Registered email address, may be empty.
+       gu_email varchar(255) binary,
 
-  -- Timestamp when the address was confirmed as belonging to the user.
-  -- NULL if not confirmed.
-  gu_email_authenticated char(14) binary,
+       -- Timestamp when the address was confirmed as belonging to the user.
+       -- NULL if not confirmed.
+       gu_email_authenticated char(14) binary,
 
-  -- Salt and hashed password
-  -- For migrated passwords, the salt is the local user_id.
-  gu_salt varchar(16) binary,
-  gu_password tinyblob,
+       -- Salt and hashed password
+       -- For migrated passwords, the salt is the local user_id.
+       gu_salt varchar(16) binary,
+       gu_password tinyblob,
 
-  -- If true, this account cannot be used to log in on any wiki.
-  gu_locked bool not null default 0,
+       -- If true, this account cannot be used to log in on any wiki.
+       gu_locked bool not null default 0,
 
-  -- If true, this account should be hidden from most public user lists.
-  -- Used for "deleting" accounts without breaking referential integrity.
-  gu_hidden varbinary(255) not null default '',
+       -- If true, this account should be hidden from most public user lists.
+       -- Used for "deleting" accounts without breaking referential integrity.
+       gu_hidden varbinary(255) not null default '',
 
-  -- Registration time
-  gu_registration varchar(14) binary,
+       -- Registration time
+       gu_registration varchar(14) binary,
 
-  -- Random key for password resets
-  gu_password_reset_key tinyblob,
-  gu_password_reset_expiration varchar(14) binary,
+       -- Random key for password resets
+       gu_password_reset_key tinyblob,
+       gu_password_reset_expiration varchar(14) binary,
 
-  -- Random key for crosswiki authentication tokens
-  gu_auth_token varbinary(32) NULL
+       -- Random key for crosswiki authentication tokens
+       gu_auth_token varbinary(32) NULL
 ) /*$wgDBTableOptions*/;
 
 CREATE UNIQUE INDEX /*i*/gu_name ON /*_*/globaluser (gu_name);
@@ -100,32 +99,32 @@
 -- All local DBs will be swept on an opt-in check event.
 --
 CREATE TABLE /*_*/localuser (
-  lu_wiki varchar(255) binary not null,
-  lu_name varchar(255) binary not null,
+       lu_wiki varchar(255) binary not null,
+       lu_name varchar(255) binary not null,
 
-  -- Migration status/logging information, to help diagnose issues
-  lu_attached_timestamp varchar(14) binary,
-  lu_attached_method enum (
-    'primary',
-    'empty',
-    'mail',
-    'password',
-    'admin',
-    'new',
-    'login'
-  ),
+       -- Migration status/logging information, to help diagnose issues
+       lu_attached_timestamp varchar(14) binary,
+       lu_attached_method enum (
+               'primary',
+               'empty',
+               'mail',
+               'password',
+               'admin',
+               'new',
+               'login'
+       ),
 
-  primary key (lu_wiki, lu_name)
+       PRIMARY KEY (lu_wiki, lu_name)
 ) /*$wgDBTableOptions*/;
 
 CREATE INDEX /*i*/lu_name_wiki ON /*_*/localuser (lu_name, lu_wiki);
 
 -- Global user groups.
 CREATE TABLE /*_*/global_user_groups (
-  gug_user int(11) not null,
-  gug_group varchar(255) not null,
+       gug_user int(11) not null,
+       gug_group varchar(255) not null,
 
-  PRIMARY KEY (gug_user,gug_group)
+       PRIMARY KEY (gug_user, gug_group)
 ) /*$wgDBTableOptions*/;
 
 CREATE INDEX /*i*/gug_user ON /*_*/global_user_groups (gug_user);
@@ -133,10 +132,10 @@
 
 -- Global group permissions.
 CREATE TABLE /*_*/global_group_permissions (
-  ggp_group varchar(255) not null,
-  ggp_permission varchar(255) not null,
+       ggp_group varchar(255) not null,
+       ggp_permission varchar(255) not null,
 
-  PRIMARY KEY (ggp_group, ggp_permission)
+       PRIMARY KEY (ggp_group, ggp_permission)
 ) /*$wgDBTableOptions*/;
 
 CREATE INDEX /*i*/ggp_group ON /*_*/global_group_permissions (ggp_group);
@@ -145,43 +144,42 @@
 -- Sets of wikis (for things like restricting global groups)
 -- May be defined in two ways: only specified wikis or all wikis except 
opt-outed
 CREATE TABLE /*_*/wikiset (
-  -- ID of wikiset
-  ws_id int primary key auto_increment,
-  -- Display name of wikiset
-  ws_name varchar(255) not null,
-  -- Type of set: opt-in or opt-out
-  ws_type enum ('optin', 'optout'),
-  -- Wikis in that set. Why isn't it a separate table?
-  -- Because we can just use such simple list, we don't need complicated 
queries on it
-  -- Let's suppose that max length of db name is 31 (32 with ","), then we 
have space for
-  -- 2048 wikis. More than we need
-  ws_wikis blob not null
+       -- ID of wikiset
+       ws_id int PRIMARY KEY AUTO_INCREMENT,
+       -- Display name of wikiset
+       ws_name varchar(255) not null,
+       -- Type of set: opt-in or opt-out
+       ws_type enum ('optin', 'optout'),
+       -- Wikis in that set. Why isn't it a separate table?
+       -- Because we can just use such simple list, we don't need complicated 
queries on it
+       -- Let's suppose that max length of db name is 31 (32 with ","), then 
we have space for
+       -- 2048 wikis. More than we need
+       ws_wikis blob not null
 ) /*$wgDBTableOptions*/;
 
 CREATE UNIQUE INDEX /*i*/ws_name ON /*_*/wikiset (ws_name);
 
 -- Allow certain global groups to have their permissions only on certain wikis
 CREATE TABLE /*_*/global_group_restrictions (
-  -- Group to restrict
-  ggr_group varchar(255) not null,
-  -- Wikiset to use
-  ggr_set int not null,
+       -- Group to restrict
+       ggr_group varchar(255) not null PRIMARY KEY AUTO_INCREMENT,
+       -- Wikiset to use
+       ggr_set int not null
 
-  PRIMARY KEY (ggr_group)
 ) /*$wgDBTableOptions*/;
 
 CREATE INDEX /*i*/ggr_set ON /*_*/global_group_restrictions (ggr_set);
 
 -- Table for global rename status
 CREATE TABLE /*_*/renameuser_status (
-  -- Old name being renamed from
-  ru_oldname varchar(255) binary not null,
-  -- New name being renamed to
-  ru_newname varchar(255) binary not null,
-  -- WikiID
-  ru_wiki varchar(255) binary not null,
-  -- current state of the renaming
-  ru_status enum ('queued', 'inprogress', 'failed')
+       -- Old name being renamed from
+       ru_oldname varchar(255) binary not null,
+       -- New name being renamed to
+       ru_newname varchar(255) binary not null,
+       -- WikiID
+       ru_wiki varchar(255) binary not null,
+       -- current state of the renaming
+       ru_status enum ('queued', 'inprogress', 'failed')
 ) /*$wgDBTableOptions*/;
 
 CREATE UNIQUE INDEX /*i*/ru_oldname ON /*_*/renameuser_status (ru_oldname, 
ru_wiki);
@@ -190,40 +188,40 @@
 -- Used to power special pages for requesting a global rename from a user's
 -- home wiki and a work queue of pending renames for stewards.
 CREATE TABLE /*_*/renameuser_queue (
-  -- Internal unique ID for the authentication server
-  rq_id int primary key auto_increment,
+       -- Internal unique ID for the authentication server
+       rq_id int PRIMARY KEY AUTO_INCREMENT,
 
-  -- User requesting to be renamed
-  -- Not a gu_id because user may not be global yet
-  rq_name varchar(255) binary not null,
+       -- User requesting to be renamed
+       -- Not a gu_id because user may not be global yet
+       rq_name varchar(255) binary not null,
 
-  -- WikiID of home wiki for requesting user
-  -- Will be null if user is a CentralAuth account
-  rq_wiki varchar(255) binary,
+       -- WikiID of home wiki for requesting user
+       -- Will be null if user is a CentralAuth account
+       rq_wiki varchar(255) binary,
 
-  -- New name being requested
-  rq_newname varchar(255) binary not null,
+       -- New name being requested
+       rq_newname varchar(255) binary not null,
 
-  -- Reason given by the user for the rename request
-  rq_reason blob,
+       -- Reason given by the user for the rename request
+       rq_reason blob,
 
-  -- Request timestamp
-  rq_requested_ts varchar(14) binary,
+       -- Request timestamp
+       rq_requested_ts varchar(14) binary,
 
-  -- Current state of the request
-  rq_status enum ('pending', 'approved', 'rejected') not null,
+       -- Current state of the request
+       rq_status enum ('pending', 'approved', 'rejected') not null,
 
-  -- Completion timestamp
-  rq_completed_ts varchar(14) binary,
+       -- Completion timestamp
+       rq_completed_ts varchar(14) binary,
 
-  -- Delete/suppress flag
-  rq_deleted tinyint unsigned not null default '0',
+       -- Delete/suppress flag
+       rq_deleted tinyint unsigned not null default '0',
 
-  -- User who completed the request (foreign key to globaluser.gu_id)
-  rq_performer int,
+       -- User who completed the request (foreign key to globaluser.gu_id)
+       rq_performer int,
 
-  -- Steward's comments on the request
-  rq_comments blob
+       -- Steward's comments on the request
+       rq_comments blob
 
 ) /*$wgDBTableOptions*/;
 
@@ -235,18 +233,18 @@
 -- who will be renamed in the
 -- glorious finalization.
 CREATE TABLE /*_*/users_to_rename (
-  -- id
-  utr_id int primary key auto_increment,
+       -- id
+       utr_id int PRIMARY KEY AUTO_INCREMENT,
 
-  -- username
-  utr_name varchar(255) binary not null,
+       -- username
+       utr_name varchar(255) binary not null,
 
-  -- wiki the user is on
-  utr_wiki varchar(255) binary not null,
+       -- wiki the user is on
+       utr_wiki varchar(255) binary not null,
 
-  -- bitfield of a user's status
-  -- could be: notified via email, talk page, and finally: renamed
-  utr_status int default 0
+       -- bitfield of a user's status
+       -- could be: notified via email, talk page, and finally: renamed
+       utr_status int default 0
 ) /*$wgDBTableOptions*/;
 
 CREATE UNIQUE INDEX /*i*/utr_user ON /*_*/users_to_rename (utr_name, utr_wiki);
diff --git a/db_patches/patch-globalgroups.sql 
b/db_patches/patch-globalgroups.sql
index 596a046..b130c2a 100644
--- a/db_patches/patch-globalgroups.sql
+++ b/db_patches/patch-globalgroups.sql
@@ -2,24 +2,24 @@
 -- Andrew Garrett (Werdna), April 2008.
 
 -- Global user groups.
-CREATE TABLE global_user_groups (
+CREATE TABLE /*_*/global_user_groups (
        gug_user int(11) not null,
        gug_group varchar(255) not null,
-
-       PRIMARY KEY (gug_user,gug_group),
-       KEY (gug_user),
-       key (gug_group)
+       PRIMARY KEY (gug_user, gug_group)
 ) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/gug_user ON /*_*/global_user_groups (gug_user);
+CREATE INDEX /*i*/gug_group ON /*_*/global_user_groups (gug_group);
 
 -- Global group permissions.
-CREATE TABLE global_group_permissions (
+CREATE TABLE /*_*/global_group_permissions (
        ggp_group varchar(255) not null,
        ggp_permission varchar(255) not null,
-
-       PRIMARY KEY (ggp_group, ggp_permission),
-       KEY (ggp_group),
-       KEY (ggp_permission)
+       PRIMARY KEY (ggp_group, ggp_permission)
 ) /*$wgDBTableOptions*/;
 
+CREATE INDEX /*i*/ggp_group ON /*_*/global_group_permissions (ggp_group);
+CREATE INDEX /*i*/ggp_permission ON /*_*/global_group_permissions 
(ggp_permission);
+
 -- Create a starter group, which users can be added to.
 INSERT INTO global_group_permissions (ggp_group,ggp_permission) VALUES 
('steward','globalgrouppermissions'),('steward','globalgroupmembership');
diff --git a/db_patches/patch-globaluser_gu_authtoken.sql 
b/db_patches/patch-globaluser_gu_authtoken.sql
index 5a060bd..9802298 100644
--- a/db_patches/patch-globaluser_gu_authtoken.sql
+++ b/db_patches/patch-globaluser_gu_authtoken.sql
@@ -1,4 +1,4 @@
 -- Adds gu_authtoken column.
 -- Used for storing a random authentication token for authenticating crosswiki.
 -- Andrew Garrett (werdna), April 2008.
-ALTER TABLE globaluser ADD COLUMN gu_auth_token varbinary(32) NULL;
+ALTER TABLE /*_*/globaluser ADD COLUMN gu_auth_token varbinary(32) NULL;
diff --git a/db_patches/patch-gu_hidden.sql b/db_patches/patch-gu_hidden.sql
index 11d7caa..98f1130 100644
--- a/db_patches/patch-gu_hidden.sql
+++ b/db_patches/patch-gu_hidden.sql
@@ -3,8 +3,7 @@
 -- get a list of hidden or locked users.
 -- Victor Vasiliev, January 2010.
 
-ALTER TABLE globaluser
-       MODIFY COLUMN gu_hidden VARBINARY(255) NOT NULL DEFAULT '';
+ALTER TABLE /*_*/globaluser MODIFY COLUMN gu_hidden VARBINARY(255) NOT NULL 
DEFAULT '';
 
 -- Not hidden (was 0)
 UPDATE globaluser SET gu_hidden = '' WHERE gu_hidden = '0';
@@ -12,6 +11,6 @@
 UPDATE globaluser SET gu_hidden = 'lists' WHERE gu_hidden = '1';
 -- There's also "suppressed" level, which wasn't used before this schema change
 
-ALTER TABLE globaluser
-       ADD INDEX gu_locked( gu_name(255), gu_locked ),
-       ADD INDEX gu_hidden( gu_name(255), gu_hidden(255) );
+ALTER TABLE /*_*/globaluser ADD INDEX gu_locked( gu_name(255), gu_locked );
+
+ALTER TABLE /*_*/globaluser ADD INDEX gu_hidden( gu_name(255), gu_hidden(255) 
);
diff --git a/db_patches/patch-lu_wiki.sql b/db_patches/patch-lu_wiki.sql
index 2f2346e..2733079 100644
--- a/db_patches/patch-lu_wiki.sql
+++ b/db_patches/patch-lu_wiki.sql
@@ -1,2 +1,3 @@
-ALTER TABLE localnames CHANGE ln_dbname ln_wiki varchar(255) binary not null;
-ALTER TABLE localuser CHANGE lu_dbname lu_wiki varchar(255) binary not null;
+ALTER TABLE /*_*/localnames CHANGE ln_dbname ln_wiki varchar(255) binary NOT 
NULL DEFAULT '';
+
+ALTER TABLE /*_*/localuser CHANGE lu_dbname lu_wiki varchar(255) binary NOT 
NULL DEFAULT '';
diff --git a/db_patches/patch-renameuser.sql b/db_patches/patch-renameuser.sql
index 16e5bbc..ef309a8 100644
--- a/db_patches/patch-renameuser.sql
+++ b/db_patches/patch-renameuser.sql
@@ -1,12 +1,12 @@
-CREATE TABLE renameuser_status (
-  -- Old name being renamed from
-  ru_oldname varchar(255) binary not null,
-  -- New name being renamed to
-  ru_newname varchar(255) binary not null,
-  -- WikiID
-  ru_wiki varchar(255) binary not null,
-  -- current state of the renaming
-  ru_status enum ('queued', 'inprogress', 'failed'),
-
-  UNIQUE KEY `ru_oldname` (`ru_oldname`, `ru_wiki`)
+CREATE TABLE /*_*/renameuser_status (
+       -- Old name being renamed from
+       ru_oldname varchar(255) binary not null,
+       -- New name being renamed to
+       ru_newname varchar(255) binary not null,
+       -- WikiID
+       ru_wiki varchar(255) binary not null,
+       -- current state of the renaming
+       ru_status enum ('queued', 'inprogress', 'failed')
 ) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/ru_oldname ON /*_*/renameuser_status (ru_oldname, 
ru_wiki);
diff --git a/db_patches/patch-requestrename-fix-wiki.sql 
b/db_patches/patch-requestrename-fix-wiki.sql
index 0bc09a1..9664b4f 100644
--- a/db_patches/patch-requestrename-fix-wiki.sql
+++ b/db_patches/patch-requestrename-fix-wiki.sql
@@ -1,4 +1,3 @@
 -- Fix a problem in the original renameuser_queue patch.
 -- We intended renameuser_queue.rq_wiki to be nullable.
-ALTER TABLE renameuser_queue
-  CHANGE COLUMN rq_wiki rq_wiki varchar(255) binary;
+ALTER TABLE /*_*/renameuser_queue CHANGE COLUMN rq_wiki rq_wiki varchar(255) 
binary;
diff --git a/db_patches/patch-requestrename.sql 
b/db_patches/patch-requestrename.sql
index 5c4d33a..f69bf1f 100644
--- a/db_patches/patch-requestrename.sql
+++ b/db_patches/patch-requestrename.sql
@@ -2,39 +2,40 @@
 -- Used to power special pages for requesting a global rename from a user's
 -- home wiki and a work queue of pending renames for stewards.
 CREATE TABLE /*_*/renameuser_queue (
-  -- Internal unique ID for the authentication server
-  rq_id int primary key auto_increment,
+       -- Internal unique ID for the authentication server
+       rq_id int PRIMARY KEY AUTO_INCREMENT,
 
-  -- User requesting to be renamed
-  -- Not a gu_id because user may not be global yet
-  rq_name varchar(255) binary not null,
+       -- User requesting to be renamed
+       -- Not a gu_id because user may not be global yet
+       rq_name varchar(255) binary not null,
 
-  -- WikiID of home wiki for requesting user
-  rq_wiki varchar(255) binary not null,
+       -- WikiID of home wiki for requesting user
+       -- Will be null if user is a CentralAuth account
+       rq_wiki varchar(255) binary,
 
-  -- New name being requested
-  rq_newname varchar(255) binary not null,
+       -- New name being requested
+       rq_newname varchar(255) binary not null,
 
-  -- Reason given by the user for the rename request
-  rq_reason blob,
+       -- Reason given by the user for the rename request
+       rq_reason blob,
 
-  -- Request timestamp
-  rq_requested_ts varchar(14) binary,
+       -- Request timestamp
+       rq_requested_ts varchar(14) binary,
 
-  -- Current state of the request
-  rq_status enum ('pending', 'approved', 'rejected') not null,
+       -- Current state of the request
+       rq_status enum ('pending', 'approved', 'rejected') not null,
 
-  -- Completion timestamp
-  rq_completed_ts varchar(14) binary,
+       -- Completion timestamp
+       rq_completed_ts varchar(14) binary,
 
-  -- Delete/suppress flag
-  rq_deleted tinyint unsigned not null default '0',
+       -- Delete/suppress flag
+       rq_deleted tinyint unsigned not null default '0',
 
-  -- User who completed the request (foreign key to globaluser.gu_id)
-  rq_performer int,
+       -- User who completed the request (foreign key to globaluser.gu_id)
+       rq_performer int,
 
-  -- Steward's comments on the request
-  rq_comments blob
+       -- Steward's comments on the request
+       rq_comments blob
 
 ) /*$wgDBTableOptions*/;
 
diff --git a/db_patches/patch-users_to_rename.sql 
b/db_patches/patch-users_to_rename.sql
index eb35864..41101bc 100644
--- a/db_patches/patch-users_to_rename.sql
+++ b/db_patches/patch-users_to_rename.sql
@@ -2,18 +2,18 @@
 -- who will be renamed in the
 -- glorious finalization.
 CREATE TABLE /*_*/users_to_rename (
-  -- id
-  utr_id int primary key auto_increment,
+       -- id
+       utr_id int PRIMARY KEY AUTO_INCREMENT,
 
-  -- username
-  utr_name varchar(255) binary not null,
+       -- username
+       utr_name varchar(255) binary not null,
 
-  -- wiki the user is on
-  utr_wiki varchar(255) binary not null,
+       -- wiki the user is on
+       utr_wiki varchar(255) binary not null,
 
-  -- bitfield of a user's status
-  -- could be: notified via email, talk page, and finally: renamed
-  utr_status int default 0
+       -- bitfield of a user's status
+       -- could be: notified via email, talk page, and finally: renamed
+       utr_status int default 0
 ) /*$wgDBTableOptions*/;
 
 CREATE UNIQUE INDEX /*i*/utr_user ON /*_*/users_to_rename (utr_name, utr_wiki);
diff --git a/db_patches/patch-wikisets.sql b/db_patches/patch-wikisets.sql
index d478fbd..c75204c 100644
--- a/db_patches/patch-wikisets.sql
+++ b/db_patches/patch-wikisets.sql
@@ -1,8 +1,8 @@
 -- Sets of wikis (for things like restricting global groups)
 -- May be defined in two ways: only specified wikis or all wikis except 
opt-outed
-CREATE TABLE wikiset (
+CREATE TABLE /*_*/wikiset (
        -- ID of wikiset
-       ws_id int auto_increment,
+       ws_id int PRIMARY KEY AUTO_INCREMENT,
        -- Display name of wikiset
        ws_name varchar(255) not null,
        -- Type of set: opt-in or opt-out
@@ -11,19 +11,19 @@
        -- Because we can just use such simple list, we don't need complicated 
queries on it
        -- Let's suppose that max length of db name is 31 (32 with ","), then 
we have space for
        -- 2048 wikis. More than we need
-       ws_wikis blob not null,
-       
-       PRIMARY KEY ws_id (ws_id),
-       UNIQUE ws_name (ws_name)
+       ws_wikis blob not null
 ) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/ws_name ON /*_*/wikiset (ws_name);
+
 
 -- Allow certain global groups to have their permissions only on certain wikis
-CREATE TABLE global_group_restrictions (
+CREATE TABLE /*_*/global_group_restrictions (
        -- Group to restrict
-       ggr_group varchar(255) not null,
+       ggr_group varchar(255) not null PRIMARY KEY AUTO_INCREMENT,
        -- Wikiset to use
-       ggr_set int not null,
+       ggr_set int not null
 
-       PRIMARY KEY (ggr_group),
-       KEY (ggr_set)
 ) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/ggr_set ON /*_*/global_group_restrictions (ggr_set);

-- 
To view, visit https://gerrit.wikimedia.org/r/190660
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13bc6a821863fbbd403d3823d4445eb1292e3f67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to