It makes it more consistent with AUTO_INCREMENT PRIMARY KEY columns on other tables. This includes ipblocks.ipb_parent_block_id and ipblocks_restrictions.ir_ipb_id as well This patch doesn't apply to Postgres. Bug: T297208 Change-Id: I950aba63b2b226abbaf4010fbb51415bbff117f4
15 lines
No EOL
953 B
SQL
15 lines
No EOL
953 B
SQL
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
|
|
-- Source: maintenance/abstractSchemaChanges/patch-ipblocks_restrictions-ir_ipb_id.json
|
|
-- Do not modify this file directly.
|
|
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
|
|
DROP INDEX ir_type_value;
|
|
CREATE TEMPORARY TABLE /*_*/__temp__ipblocks_restrictions AS
|
|
SELECT ir_ipb_id, ir_type, ir_value
|
|
FROM /*_*/ipblocks_restrictions;
|
|
DROP TABLE /*_*/ipblocks_restrictions;
|
|
CREATE TABLE /*_*/ipblocks_restrictions ( ir_ipb_id INTEGER UNSIGNED NOT NULL, ir_type SMALLINT NOT NULL, ir_value INTEGER UNSIGNED NOT NULL, PRIMARY KEY(ir_ipb_id, ir_type, ir_value) );
|
|
INSERT INTO /*_*/ipblocks_restrictions (ir_ipb_id, ir_type, ir_value)
|
|
SELECT ir_ipb_id, ir_type, ir_value
|
|
FROM /*_*/__temp__ipblocks_restrictions;
|
|
DROP TABLE /*_*/__temp__ipblocks_restrictions;
|
|
CREATE INDEX ir_type_value ON /*_*/ipblocks_restrictions (ir_type, ir_value); |