예제 #1
0
	);

	$upgrade->run_query(
		sprintf($upgrade_phrases['upgrade_300b3.php']['altering_x_table'], 'reputation', 2, 2),
		"ALTER IGNORE TABLE " . TABLE_PREFIX . "reputation ADD UNIQUE INDEX
			whoadded_postid (whoadded, postid)",
		MYSQL_ERROR_KEY_EXISTS
	);

	$upgrade->execute();
}

// #############################################################################
if ($vbulletin->GPC['step'] == 2)
{
	$hightrafficengine = get_high_concurrency_table_engine($db);

	$upgrade->add_field(
		sprintf($upgrade_phrases['upgrade_300b3.php']['altering_x_table'], 'subscribegroup', 1, 1),
		'subscribegroup',
		'emailupdate',
		'enum',
		array('attributes' => "('daily', 'weekly', 'none')", 'null' => false, 'default' => 'none')
	);

	$upgrade->add_field(
		sprintf($upgrade_phrases['upgrade_300b3.php']['altering_x_table'], 'forum', 1, 1),
		'forum',
		'lastposterid',
		'int',
		FIELD_DEFAULTS
예제 #2
0
 /**
  * Constructor.
  *
  * @param	vB_Registry	Reference to registry object
  * @param	Array		Phrases
  * @param	string	Max upgrade version
  */
 public function __construct(&$registry, $phrase, $maxversion)
 {
     if (is_object($registry)) {
         $this->registry =& $registry;
         $this->db =& $this->registry->db;
         if (VB_AREA == 'Upgrade') {
             if (!isset($this->registry->options['upgrade_from']) or empty($this->registry->options['upgrade_from'])) {
                 $this->set_new_option('upgrade_from', 'version', $this->registry->options['templateversion'], 'string', '');
                 $this->registry->options['upgrade_from'] = $this->registry->options['templateversion'];
             }
         }
     } else {
         trigger_error('vB_Upgrade: $this->registry is not an object.', E_USER_ERROR);
     }
     $this->phrase =& $phrase;
     $this->maxversion = $maxversion;
     foreach (get_class_methods($this) as $method_name) {
         if (preg_match('#^step_(\\d+)$#', $method_name, $matches)) {
             $this->stepcount++;
         }
     }
     // Maintain backwards compatibility with install system
     require_once DIR . '/install/functions_installupgrade.php';
     $this->hightrafficengine = get_high_concurrency_table_engine($this->db);
     require_once DIR . '/includes/class_dbalter.php';
 }