Create table with dbDelta,can't put any DEFAULT data
I want to add more custom tables to wp_users.
but I want them to contain a default JSON data.
This one works...when the DEFAULT is empty...
register_activation_hook(__FILE__, 'toto_user_db_setup');
function toto_user_db_setup() {
global $wpdb;
$user_data = "wp_users";
$charset_collate = $wpdb-get_charset_collate();
$game_1 = "CREATE TABLE $user_data (
data1 tinytext DEFAULT '' NOT NULL,
data2 tinytext DEFAULT '' NOT NULL,
data3 mediumtext DEFAULT '' NOT NULL,
data4 mediumtext DEFAULT '' NOT NULL,
data5 longtext DEFAULT '' NOT NULL
) $charset_collate;";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta($game_1);
}
But when i put inside DEFAULT any value... it does not work at all.
register_activation_hook(__FILE__, 'toto_user_db_setup');
function toto_user_db_setup() {
global $wpdb;
$user_data = "wp_users";
$charset_collate = $wpdb-get_charset_collate();
$game_1 = "CREATE TABLE $user_data (
data1 tinytext DEFAULT 'test1' NOT NULL,
data2 tinytext DEFAULT 'test2' NOT NULL,
data3 mediumtext DEFAULT 'hello' NOT NULL,
data4 mediumtext DEFAULT '2132' NOT NULL,
data5 longtext DEFAULT 'dada' NOT NULL
) $charset_collate;";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta($game_1);
}
I did try to make it work hours.....but nothing.... please help.