'page', 'archive' => 'ar', 'recentchanges' => 'rc', 'watchlist' => 'wl', 'querycache' => 'qc', 'logging' => 'log', ); foreach ( $tables as $table => $prefix ) { $field = $prefix . '_namespace'; $tablename = $this->db->tableName( $table ); $result = $this->db->query( "SHOW COLUMNS FROM $tablename LIKE '$field'" ); $info = $this->db->fetchObject( $result ); if ( substr( $info->Type, 0, 3 ) == 'int' ) { wfOut( "...$field is already a full int ($info->Type).\n" ); } else { wfOut( "Promoting $field from $info->Type to int... " ); $sql = "ALTER TABLE $tablename MODIFY $field int NOT NULL"; $this->db->query( $sql ); wfOut( "ok\n" ); } } } }