Okay so I must have read hundreds of wordpress answers, google results etc on different people having trouble with dbDelta creating tables for their plugins.
Ive tried many variations based off of those answers to see if it would do the trick but this code below does not seem to create the table. Even though the returned data from dbDelta says it created the table, if there is any help anyone can give me or see the error that I've made, I would be very grateful.
function activation() {
// Install table
global $wpdb;
$sql = "CREATE TABLE ".$this->table_name." (
id MEDIUMINT(9) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
user_id BIGINT(20) NOT NULL UNSIGNED,
KEY user_id (user_id),
created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
url VARCHAR(55) DEFAULT '' NOT NULL,
);";
var_dump($sql);
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
var_dump(dbDelta( $sql ));
add_option( "invite_db_version", $invite_db_version );
}
This function is registered to the activation hook in the constructor of my plugin class register_activation_hook( __FILE__, array( &$this, 'activation' ) );