* @param $patchFile String: path to the patch to correct the field
*/
protected function checkBin( $table, $field, $patchFile ) {
+ if ( !$this->doTable( $table ) ) {
+ return true;
+ }
+
$tableName = $this->db->tableName( $table );
$res = $this->db->query( "SELECT $field FROM $tableName LIMIT 0", __METHOD__ );
$flags = explode( ' ', mysql_field_flags( $res->result, 0 ) );
* @return Boolean
*/
protected function indexHasField( $table, $index, $field ) {
+ if ( !$this->doTable( $table ) ) {
+ return true;
+ }
+
$info = $this->db->indexInfo( $table, $index, __METHOD__ );
if ( $info ) {
foreach ( $info as $row ) {
protected function doInterwikiUpdate() {
global $IP;
+ if ( !$this->doTable( 'interwiki' ) ) {
+ return true;
+ }
+
if ( $this->db->tableExists( "interwiki", __METHOD__ ) ) {
$this->output( "...already have interwiki table\n" );
return;
}
protected function doUserUniqueUpdate() {
+ if ( !$this->doTable( 'user' ) ) {
+ return true;
+ }
+
$duper = new UserDupes( $this->db, array( $this, 'output' ) );
if ( $duper->hasUniqueIndex() ) {
$this->output( "...already have unique user_name index.\n" );
}
protected function doUserGroupsUpdate() {
+ if ( !$this->doTable( 'user_groups' ) ) {
+ return true;
+ }
+
if ( $this->db->tableExists( 'user_groups', __METHOD__ ) ) {
$info = $this->db->fieldInfo( 'user_groups', 'ug_group' );
if ( $info->type() == 'int' ) {
protected function doEnableProfiling() {
global $wgProfileToDatabase;
+
+ if ( !$this->doTable( 'profiling' ) ) {
+ return true;
+ }
+
if ( $wgProfileToDatabase === true && ! $this->db->tableExists( 'profiling', __METHOD__ ) ) {
$this->applyPatch( 'patch-profiling.sql', false, 'Add profiling table' );
}
}
protected function doMaybeProfilingMemoryUpdate() {
+ if ( !$this->doTable( 'profiling' ) ) {
+ return true;
+ }
+
if ( !$this->db->tableExists( 'profiling', __METHOD__ ) ) {
return true;
} elseif ( $this->db->fieldExists( 'profiling', 'pf_memory', __METHOD__ ) ) {
}
protected function doUserNewTalkTimestampNotNull() {
+ if ( !$this->doTable( 'user_newtalk' ) ) {
+ return true;
+ }
+
$info = $this->db->fieldInfo( 'user_newtalk', 'user_last_timestamp' );
if ( $info === false ) {
return;