[Solved] register_activation_hook not creating table

Puspalata Panigrahi Asks: 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 :


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 );        

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.