From: This, that and the other Date: Wed, 1 Feb 2017 14:57:09 +0000 (+1100) Subject: Don't try to drop ug_user_group index if it doesn't exist X-Git-Tag: 1.31.0-rc.0~4171^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=ae8916eef928a8e96d9afa0b13c91c2d60bb2ae9;p=lhc%2Fweb%2Fwiklou.git Don't try to drop ug_user_group index if it doesn't exist This is needed for MySQL only. Bug: T156901 Change-Id: I351fa1b7ce5a9b1c7b19ecb7d26d8a1f699d88f8 --- diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 7a27f5f2eb..9be6c3d65c 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -294,6 +294,7 @@ class MysqlUpdater extends DatabaseUpdater { // 1.29 [ 'addField', 'externallinks', 'el_index_60', 'patch-externallinks-el_index_60.sql' ], + [ 'dropIndex', 'user_groups', 'ug_user_group', 'patch-user_groups-primary-key.sql' ], [ 'addField', 'user_groups', 'ug_expiry', 'patch-user_groups-ug_expiry.sql' ], ]; } diff --git a/maintenance/archives/patch-user_groups-primary-key.sql b/maintenance/archives/patch-user_groups-primary-key.sql new file mode 100644 index 0000000000..e3c8735660 --- /dev/null +++ b/maintenance/archives/patch-user_groups-primary-key.sql @@ -0,0 +1,5 @@ +-- Convert unique index into a primary key on user_groups + +ALTER TABLE /*$wgDBprefix*/user_groups + DROP INDEX ug_user_group, + ADD PRIMARY KEY (ug_user, ug_group); diff --git a/maintenance/archives/patch-user_groups-ug_expiry.sql b/maintenance/archives/patch-user_groups-ug_expiry.sql index 2ce2c9e84d..b329f9488d 100644 --- a/maintenance/archives/patch-user_groups-ug_expiry.sql +++ b/maintenance/archives/patch-user_groups-ug_expiry.sql @@ -1,7 +1,5 @@ --- Primary key and expiry column in user_groups table +-- Add expiry column in user_groups table ALTER TABLE /*$wgDBprefix*/user_groups - DROP INDEX ug_user_group, - ADD PRIMARY KEY (ug_user, ug_group), ADD COLUMN ug_expiry varbinary(14) NULL default NULL, ADD INDEX ug_expiry (ug_expiry);