bp_core_upgrade_signups()

Update the signups table, adding signup_id column and drop domain index.


Description Description

This is necessary because WordPress’s pre_schema_upgrade() function wraps table ALTER’s in multisite checks, and other plugins may have installed their own sign-ups table; Eg: Gravity Forms User Registration Add On.

See also See also


Top ↑

Source Source

File: bp-core/admin/bp-core-admin-schema.php

function bp_core_upgrade_signups() {
	global $wpdb;

	// Bail if global tables should not be upgraded.
	if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
		return;
	}

	// Never use bp_core_get_table_prefix() for any global users tables.
	$wpdb->signups = $wpdb->base_prefix . 'signups';

	// Attempt to alter the signups table.
	$wpdb->query( "ALTER TABLE {$wpdb->signups} ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" );
	$wpdb->query( "ALTER TABLE {$wpdb->signups} DROP INDEX domain" );
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.0.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.