[ 'addPgField', 'image', 'img_sha1', "TEXT NOT NULL DEFAULT ''" ],
[ 'addPgField', 'ipblocks', 'ipb_allow_usertalk', 'SMALLINT NOT NULL DEFAULT 0' ],
[ 'addPgField', 'ipblocks', 'ipb_anon_only', 'SMALLINT NOT NULL DEFAULT 0' ],
- [ 'addPgField', 'ipblocks', 'ipb_by_text', "TEXT NOT NULL DEFAULT ''" ],
+ [ 'ifNoActorTable', 'addPgField', 'ipblocks', 'ipb_by_text', "TEXT NOT NULL DEFAULT ''" ],
[ 'addPgField', 'ipblocks', 'ipb_block_email', 'SMALLINT NOT NULL DEFAULT 0' ],
[ 'addPgField', 'ipblocks', 'ipb_create_account', 'SMALLINT NOT NULL DEFAULT 1' ],
[ 'addPgField', 'ipblocks', 'ipb_deleted', 'SMALLINT NOT NULL DEFAULT 0' ],
[ 'addPgField', 'revision', 'rev_content_format', 'TEXT' ],
[ 'addPgField', 'site_stats', 'ss_active_users', "INTEGER DEFAULT '-1'" ],
[ 'addPgField', 'user_newtalk', 'user_last_timestamp', 'TIMESTAMPTZ' ],
- [ 'addPgField', 'logging', 'log_user_text', "TEXT NOT NULL DEFAULT ''" ],
+ [ 'ifNoActorTable', 'addPgField', 'logging', 'log_user_text', "TEXT NOT NULL DEFAULT ''" ],
[ 'addPgField', 'logging', 'log_page', 'INTEGER' ],
[ 'addPgField', 'interwiki', 'iw_api', "TEXT NOT NULL DEFAULT ''" ],
[ 'addPgField', 'interwiki', 'iw_wikiid', "TEXT NOT NULL DEFAULT ''" ],
[ 'checkOiDeleted' ],
# New indexes
- [ 'addPgIndex', 'archive', 'archive_user_text', '(ar_user_text)' ],
+ [ 'ifNoActorTable', 'addPgIndex', 'archive', 'archive_user_text', '(ar_user_text)' ],
[ 'addPgIndex', 'image', 'img_sha1', '(img_sha1)' ],
[ 'addPgIndex', 'ipblocks', 'ipb_parent_block_id', '(ipb_parent_block_id)' ],
[ 'addPgIndex', 'oldimage', 'oi_sha1', '(oi_sha1)' ],
[ 'addPgIndex', 'watchlist', 'wl_user', '(wl_user)' ],
[ 'addPgIndex', 'watchlist', 'wl_user_notificationtimestamp',
'(wl_user, wl_notificationtimestamp)' ],
- [ 'addPgIndex', 'logging', 'logging_user_type_time',
+ [ 'ifNoActorTable', 'addPgIndex', 'logging', 'logging_user_type_time',
'(log_user, log_type, log_timestamp)' ],
[ 'addPgIndex', 'logging', 'logging_page_id_time', '(log_page,log_timestamp)' ],
[ 'addPgIndex', 'iwlinks', 'iwl_prefix_from_title', '(iwl_prefix, iwl_from, iwl_title)' ],
[ 'addPgIndex', 'job', 'job_cmd_token', '(job_cmd, job_token, job_random)' ],
[ 'addPgIndex', 'job', 'job_cmd_token_id', '(job_cmd, job_token, job_id)' ],
[ 'addPgIndex', 'filearchive', 'fa_sha1', '(fa_sha1)' ],
- [ 'addPgIndex', 'logging', 'logging_user_text_type_time',
+ [ 'ifNoActorTable', 'addPgIndex', 'logging', 'logging_user_text_type_time',
'(log_user_text, log_type, log_timestamp)' ],
- [ 'addPgIndex', 'logging', 'logging_user_text_time', '(log_user_text, log_timestamp)' ],
+ [ 'ifNoActorTable', 'addPgIndex', 'logging', 'logging_user_text_time',
+ '(log_user_text, log_timestamp)' ],
[ 'checkIndex', 'pagelink_unique', [
[ 'pl_from', 'int4_ops', 'btree', 0 ],
[ 'checkIwlPrefix' ],
# All FK columns should be deferred
- [ 'changeFkeyDeferrable', 'archive', 'ar_user', 'mwuser(user_id) ON DELETE SET NULL' ],
+ [ 'ifNoActorTable', 'changeFkeyDeferrable', 'archive', 'ar_user',
+ 'mwuser(user_id) ON DELETE SET NULL' ],
[ 'changeFkeyDeferrable', 'categorylinks', 'cl_from', 'page(page_id) ON DELETE CASCADE' ],
[ 'changeFkeyDeferrable', 'externallinks', 'el_from', 'page(page_id) ON DELETE CASCADE' ],
[ 'changeFkeyDeferrable', 'filearchive', 'fa_deleted_user',
'mwuser(user_id) ON DELETE SET NULL' ],
- [ 'changeFkeyDeferrable', 'filearchive', 'fa_user', 'mwuser(user_id) ON DELETE SET NULL' ],
- [ 'changeFkeyDeferrable', 'image', 'img_user', 'mwuser(user_id) ON DELETE SET NULL' ],
+ [ 'ifNoActorTable', 'changeFkeyDeferrable', 'filearchive', 'fa_user',
+ 'mwuser(user_id) ON DELETE SET NULL' ],
+ [ 'ifNoActorTable', 'changeFkeyDeferrable', 'image', 'img_user',
+ 'mwuser(user_id) ON DELETE SET NULL' ],
[ 'changeFkeyDeferrable', 'imagelinks', 'il_from', 'page(page_id) ON DELETE CASCADE' ],
- [ 'changeFkeyDeferrable', 'ipblocks', 'ipb_by', 'mwuser(user_id) ON DELETE CASCADE' ],
+ [ 'ifNoActorTable', 'changeFkeyDeferrable', 'ipblocks', 'ipb_by',
+ 'mwuser(user_id) ON DELETE CASCADE' ],
[ 'changeFkeyDeferrable', 'ipblocks', 'ipb_user', 'mwuser(user_id) ON DELETE SET NULL' ],
[ 'changeFkeyDeferrable', 'ipblocks', 'ipb_parent_block_id',
'ipblocks(ipb_id) ON DELETE SET NULL' ],
[ 'changeFkeyDeferrable', 'langlinks', 'll_from', 'page(page_id) ON DELETE CASCADE' ],
- [ 'changeFkeyDeferrable', 'logging', 'log_user', 'mwuser(user_id) ON DELETE SET NULL' ],
+ [ 'ifNoActorTable', 'changeFkeyDeferrable', 'logging', 'log_user',
+ 'mwuser(user_id) ON DELETE SET NULL' ],
[ 'changeFkeyDeferrable', 'oldimage', 'oi_name',
'image(img_name) ON DELETE CASCADE ON UPDATE CASCADE' ],
- [ 'changeFkeyDeferrable', 'oldimage', 'oi_user', 'mwuser(user_id) ON DELETE SET NULL' ],
+ [ 'ifNoActorTable', 'changeFkeyDeferrable', 'oldimage', 'oi_user',
+ 'mwuser(user_id) ON DELETE SET NULL' ],
[ 'changeFkeyDeferrable', 'pagelinks', 'pl_from', 'page(page_id) ON DELETE CASCADE' ],
[ 'changeFkeyDeferrable', 'page_props', 'pp_page', 'page (page_id) ON DELETE CASCADE' ],
[ 'changeFkeyDeferrable', 'page_restrictions', 'pr_page',
'page(page_id) ON DELETE CASCADE' ],
[ 'changeFkeyDeferrable', 'protected_titles', 'pt_user',
'mwuser(user_id) ON DELETE SET NULL' ],
- [ 'changeFkeyDeferrable', 'recentchanges', 'rc_user',
+ [ 'ifNoActorTable', 'changeFkeyDeferrable', 'recentchanges', 'rc_user',
'mwuser(user_id) ON DELETE SET NULL' ],
[ 'changeFkeyDeferrable', 'redirect', 'rd_from', 'page(page_id) ON DELETE CASCADE' ],
[ 'changeFkeyDeferrable', 'revision', 'rev_page', 'page (page_id) ON DELETE CASCADE' ],
[ 'dropDefault', 'logging', 'log_comment_id' ],
[ 'dropPgField', 'protected_titles', 'pt_reason' ],
[ 'dropDefault', 'protected_titles', 'pt_reason_id' ],
+
+ // 1.34
+ [ 'dropPgIndex', 'archive', 'archive_user_text' ],
+ [ 'dropPgField', 'archive', 'ar_user' ],
+ [ 'dropPgField', 'archive', 'ar_user_text' ],
+ [ 'dropDefault', 'archive', 'ar_actor' ],
+ [ 'dropPgField', 'ipblocks', 'ipb_by' ],
+ [ 'dropPgField', 'ipblocks', 'ipb_by_text' ],
+ [ 'dropDefault', 'ipblocks', 'ipb_by_actor' ],
+ [ 'dropPgField', 'image', 'img_user' ],
+ [ 'dropPgField', 'image', 'img_user_text' ],
+ [ 'dropDefault', 'image', 'img_actor' ],
+ [ 'dropPgField', 'oldimage', 'oi_user' ],
+ [ 'dropPgField', 'oldimage', 'oi_user_text' ],
+ [ 'dropDefault', 'oldimage', 'oi_actor' ],
+ [ 'dropPgField', 'filearchive', 'fa_user' ],
+ [ 'dropPgField', 'filearchive', 'fa_user_text' ],
+ [ 'dropDefault', 'filearchive', 'fa_actor' ],
+ [ 'dropPgField', 'recentchanges', 'rc_user' ],
+ [ 'dropPgField', 'recentchanges', 'rc_user_text' ],
+ [ 'dropDefault', 'recentchanges', 'rc_actor' ],
+ [ 'dropPgIndex', 'logging', 'logging_user_time' ],
+ [ 'dropPgIndex', 'logging', 'logging_user_type_time' ],
+ [ 'dropPgIndex', 'logging', 'logging_user_text_type_time' ],
+ [ 'dropPgIndex', 'logging', 'logging_user_text_time' ],
+ [ 'dropPgField', 'logging', 'log_user' ],
+ [ 'dropPgField', 'logging', 'log_user_text' ],
+ [ 'dropDefault', 'logging', 'log_actor' ],
];
}
if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
$this->output( "...skipping: '$table' table doesn't exist yet.\n" );
- return;
+ return true;
}
// Second requirement: the new index must be missing
" $old should be manually removed if not needed anymore.\n" );
}
- return;
+ return true;
}
// Third requirement: the old index must exist
if ( !$this->db->indexExists( $table, $old, __METHOD__ ) ) {
$this->output( "...skipping: index $old doesn't exist.\n" );
- return;
+ return true;
}
$this->db->query( "ALTER INDEX $old RENAME TO $new" );
+ return true;
}
protected function dropPgField( $table, $field ) {
public function addPgExtIndex( $table, $index, $type ) {
if ( $this->db->indexExists( $table, $index ) ) {
$this->output( "...index '$index' on table '$table' already exists\n" );
+ } elseif ( preg_match( '/^\(/', $type ) ) {
+ $this->output( "Creating index '$index' on table '$table'\n" );
+ $this->db->query( "CREATE INDEX $index ON $table $type" );
} else {
- if ( preg_match( '/^\(/', $type ) ) {
- $this->output( "Creating index '$index' on table '$table'\n" );
- $this->db->query( "CREATE INDEX $index ON $table $type" );
- } else {
- $this->applyPatch( $type, true, "Creating index '$index' on table '$table'" );
- }
+ $this->applyPatch( $type, true, "Creating index '$index' on table '$table'" );
}
}
$this->db->query( $command );
} else {
$this->output( "...foreign key constraint on '$table.$field' already does not exist\n" );
- };
+ }
}
protected function changeFkeyDeferrable( $table, $field, $clause ) {
if ( $this->updateRowExists( 'patch-textsearch_bug66650.sql' ) ) {
$this->output( "...T68650 already fixed or not applicable.\n" );
return;
- };
+ }
$this->applyPatch( 'patch-textsearch_bug66650.sql', false,
'Rebuilding text search for T68650' );
}