Site icon Hip-Hop Website Design and Development

register_activation_hook not creating table

As my question is duplicate, still i am stuff in my code, no solution found.

I create a function in the plugin to create a table after activating the plugin. But the table is not creating after activate the plugin.I have placed this code in main file of my plugin.

Please overlook my code :

register_activation_hook(__FILE__,'like_dislike_counter_install');

function like_dislike_counter_install() {
    global $wpdb;

    $table_name = $wpdb->prefix . 'subpostvotingcount';
    $charset_collate = $wpdb->get_charset_collate();

    $sql = "CREATE TABLE $table_name (
          sno int(10) NOT NULL AUTO_INCREMENT,
          postid int(50) NOT NULL,
          subpostid varchar(5) NOT NULL,
          votingcount varchar(50) NOT NULL,
          postclicktime timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP
        )  $charset_collate;";

    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    dbDelta( $sql );        
}