(formerly it was needed by PostgreSQL and Oracle), and is now deprecated.
* (T146591) The lc_lang_key index on the l10n_cache table has been changed into a
PRIMARY KEY.
+* (T157227) bot_password.bp_user, change_tag.ct_log_id, change_tag.ct_rev_id,
+ page_restrictions.pr_user, tag_summary.ts_log_id, tag_summary.ts_rev_id and
+ user_properties.up_user have all been made unsigned on MySQL.
== Compatibility ==
MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for
'patch-fa_major_mime-chemical.sql' ],
// 1.25
- [ 'doUserNewTalkUseridUnsigned' ],
// note this patch covers other _comment and _description fields too
[ 'modifyField', 'recentchanges', 'rc_comment', 'patch-editsummary-length.sql' ],
[ 'migrateComments' ],
[ 'renameIndex', 'l10n_cache', 'lc_lang_key', 'PRIMARY', false,
'patch-l10n_cache-primary-key.sql' ],
+ [ 'doUnsignedSyncronisation' ],
];
}
);
}
- protected function doUserNewTalkUseridUnsigned() {
- if ( !$this->doTable( 'user_newtalk' ) ) {
- return true;
- }
+ protected function doUnsignedSyncronisation() {
+ $sync = [
+ [ 'table' => 'bot_passwords', 'field' => 'bp_user' ],
+ [ 'table' => 'change_tag', 'field' => 'ct_log_id' ],
+ [ 'table' => 'change_tag', 'field' => 'ct_rev_id' ],
+ [ 'table' => 'page_restrictions', 'field' => 'pr_user' ],
+ [ 'table' => 'tag_summary', 'field' => 'ts_log_id' ],
+ [ 'table' => 'tag_summary', 'field' => 'ts_rev_id' ],
+ [ 'table' => 'user_newtalk', 'field' => 'user_id' ],
+ [ 'table' => 'user_properties', 'field' => 'up_user' ],
+ ];
- $info = $this->db->fieldInfo( 'user_newtalk', 'user_id' );
- if ( $info === false ) {
- return true;
- }
- if ( $info->isUnsigned() ) {
- $this->output( "...user_id is already unsigned int.\n" );
+ foreach ( $sync as $s ) {
+ if ( !$this->doTable( $s['table'] ) ) {
+ continue;
+ }
- return true;
+ $info = $this->db->fieldInfo( $s['table'], $s['field'] );
+ if ( $info === false ) {
+ continue;
+ }
+ $fullName = "{$s['table']}.{$s['field']}";
+ if ( $info->isUnsigned() ) {
+ $this->output( "...$fullName is already unsigned int.\n" );
+
+ continue;
+ }
+
+ $this->applyPatch(
+ "patch-{$s['table']}-{$s['field']}-unsigned.sql",
+ false,
+ "Making $fullName into an unsigned int"
+ );
}
- return $this->applyPatch(
- 'patch-user-newtalk-userid-unsigned.sql',
- false,
- 'Making user_id unsigned int'
- );
+ return true;
}
protected function doRevisionPageRevIndexNonUnique() {
--
CREATE TABLE /*_*/user_properties (
-- Foreign key to user.user_id
- up_user int NOT NULL,
+ up_user int unsigned NOT NULL,
-- Name of the option being saved. This is indexed for bulk lookup.
up_property varbinary(255) NOT NULL,
--
CREATE TABLE /*_*/bot_passwords (
-- User ID obtained from CentralIdLookup.
- bp_user int NOT NULL,
+ bp_user int unsigned NOT NULL,
-- Application identifier
bp_app_id varbinary(32) NOT NULL,
-- Whether or not to cascade the protection down to pages transcluded.
pr_cascade tinyint NOT NULL,
-- Field for future support of per-user restriction.
- pr_user int NULL,
+ pr_user int unsigned NULL,
-- Field for time-limited protection.
pr_expiry varbinary(14) NULL
) /*$wgDBTableOptions*/;
-- RCID for the change
ct_rc_id int NULL,
-- LOGID for the change
- ct_log_id int NULL,
+ ct_log_id int unsigned NULL,
-- REVID for the change
- ct_rev_id int NULL,
+ ct_rev_id int unsigned NULL,
-- Tag applied
ct_tag varchar(255) NOT NULL,
-- Parameters for the tag, presently unused
-- RCID for the change
ts_rc_id int NULL,
-- LOGID for the change
- ts_log_id int NULL,
+ ts_log_id int unsigned NULL,
-- REVID for the change
- ts_rev_id int NULL,
+ ts_rev_id int unsigned NULL,
-- Comma-separated list of tags
ts_tags blob NOT NULL
) /*$wgDBTableOptions*/;