I'm not sure why this isn't running. When I output dbDelta it says that it created the table, but it doesn't.
I think my SQL is valid. Taking everything out between id and UNIQUE KEY results in the table being made, but I don't see the problem with the other lines.
Thanks
function email_install () {
global $wpdb;
$table_name = $wpdb->prefix . "table_name_email";
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE " . $table_name . " (
id INT NOT NULL AUTO_INCREMENT,
time DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
email VARCHAR NOT NULL,
page VARCHAR NOT NULL,
UNIQUE KEY (id)
) ". $charset_collate . ";";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
}