Rename ipb_address to ipb_address_unique
This is how it's named in WMF production and the Postgres. Converging names would help us to keep everything consistent, for example if we need to force this index in the code. For changing this index in Sqlite, we don't need to make a temp table as this only touches the index and not the table structure. Bug: T250071 Change-Id: I0838753b809680af3ee06d9c4f6d21d95b8982cc
This commit is contained in:
parent
eb88d78c3a
commit
d779d2889a
5 changed files with 8 additions and 1 deletions
|
|
@ -412,6 +412,8 @@ class MysqlUpdater extends DatabaseUpdater {
|
|||
// 1.35
|
||||
[ 'addTable', 'watchlist_expiry', 'patch-watchlist_expiry.sql' ],
|
||||
[ 'modifyField', 'page', 'page_restrictions', 'patch-page_restrictions-null.sql' ],
|
||||
[ 'renameIndex', 'ipblocks', 'ipb_address', 'ipb_address_unique', false,
|
||||
'patch-ipblocks-rename-ipb_address.sql' ],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -282,6 +282,8 @@ class SqliteUpdater extends DatabaseUpdater {
|
|||
[ 'modifyfield', 'recentchanges', 'rc_actor', 'patch-recentchanges-drop-rc_actor-DEFAULT.sql' ],
|
||||
[ 'modifyfield', 'logging', 'log_actor', 'patch-logging-drop-log_actor-DEFAULT.sql' ],
|
||||
[ 'modifyField', 'page', 'page_restrictions', 'patch-page_restrictions-null.sql' ],
|
||||
[ 'renameIndex', 'ipblocks', 'ipb_address', 'ipb_address_unique', false,
|
||||
'patch-ipblocks-rename-ipb_address.sql' ],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE /*_*/ipblocks DROP INDEX /*i*/ipb_address, ADD UNIQUE INDEX /*i*/ipb_address_unique (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
DROP INDEX /*i*/ipb_address;
|
||||
CREATE UNIQUE INDEX /*i*/ipb_address_unique ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
|
||||
|
|
@ -1090,7 +1090,7 @@ CREATE TABLE /*_*/ipblocks (
|
|||
|
||||
-- Unique index to support "user already blocked" messages
|
||||
-- Any new options which prevent collisions should be included
|
||||
CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
|
||||
CREATE UNIQUE INDEX /*i*/ipb_address_unique ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
|
||||
|
||||
-- For querying whether a logged-in user is blocked
|
||||
CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user);
|
||||
|
|
|
|||
Loading…
Reference in a new issue