[ 'addField', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ],
// 1.15
- [ 'doUniquePlTlIl' ],
[ 'addTable', 'change_tag', 'patch-change_tag.sql' ],
[ 'addTable', 'tag_summary', 'patch-tag_summary.sql' ],
[ 'addTable', 'valid_tag', 'patch-valid_tag.sql' ],
// 1.28
[ 'addIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp',
'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
- [ 'doRevisionPageRevIndexNonUnique' ]
+ [ 'doRevisionPageRevIndexNonUnique' ],
+ [ 'doNonUniquePlTlIl' ],
];
}
return true;
}
- protected function doUniquePlTlIl() {
+ protected function doNonUniquePlTlIl() {
$info = $this->db->indexInfo( 'pagelinks', 'pl_namespace' );
- if ( is_array( $info ) && !$info[0]->Non_unique ) {
- $this->output( "...pl_namespace, tl_namespace, il_to indices are already UNIQUE.\n" );
+ if ( is_array( $info ) && $info[0]->Non_unique ) {
+ $this->output( "...pl_namespace, tl_namespace, il_to indices are already non-UNIQUE.\n" );
return true;
}
if ( $this->skipSchema ) {
$this->output( "...skipping schema change (making pl_namespace, tl_namespace " .
- "and il_to indices UNIQUE).\n" );
+ "and il_to indices non-UNIQUE).\n" );
return false;
}
return $this->applyPatch(
- 'patch-pl-tl-il-unique.sql',
+ 'patch-pl-tl-il-nonunique.sql',
false,
- 'Making pl_namespace, tl_namespace and il_to indices UNIQUE'
+ 'Making pl_namespace, tl_namespace and il_to indices non-UNIQUE'
);
}
--- /dev/null
+-- Make reorderings of UNIQUE indices non-UNIQUE
+-- Since 1.24, these indices have been non-UNIQUE in tables.sql.
+-- However, an earlier update from 1.15 that made the indices
+-- UNIQUE was not removed until 1.28 (T78513).
+
+DROP INDEX /*i*/pl_namespace ON /*_*/pagelinks;
+CREATE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace, pl_title, pl_from);
+DROP INDEX /*i*/tl_namespace ON /*_*/templatelinks;
+CREATE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace, tl_title, tl_from);
+DROP INDEX /*i*/il_to ON /*_*/imagelinks;
+CREATE INDEX /*i*/il_to ON /*_*/imagelinks (il_to, il_from);
+++ /dev/null
---
--- patch-pl-tl-il-unique-index.sql
---
--- Make reorderings of UNIQUE indices UNIQUE as well
-
-DROP INDEX /*i*/pl_namespace ON /*_*/pagelinks;
-CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace, pl_title, pl_from);
-DROP INDEX /*i*/tl_namespace ON /*_*/templatelinks;
-CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace, tl_title, tl_from);
-DROP INDEX /*i*/il_to ON /*_*/imagelinks;
-CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to, il_from);