<?php

 
  $table_name = $wpdb->prefix . "clickbar"; 
  //drop the exiting table if there is one
  $sql="DROP TABLE $table_name";
  $wpdb->query( $sql );
                                                                                        
  $sql = "CREATE TABLE IF NOT EXISTS $table_name (
  `C_ID` int(7) NOT NULL AUTO_INCREMENT,
  `ClickBarName` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `BarColor` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `CountDownDate` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `CountDownTime` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `DateOrTime` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `BarText` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ButtonText` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `BarTexture` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `RedirectURL` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `Position` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `EndText` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `BarTextColor` varchar(6) COLLATE utf8_unicode_ci NOT NULL,
  UNIQUE KEY C_ID (C_ID)

  );";
 dbDelta( $sql );  
 
 $table_name = $wpdb->prefix . "clickbar_hits"; 
  //drop the exiting table if there is one
  $sql="DROP TABLE $table_name";
  $wpdb->query( $sql );
                                                                                        
  $sql = "CREATE TABLE IF NOT EXISTS $table_name (
  `H_ID` int(7) NOT NULL AUTO_INCREMENT,
  `DateX` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `ForBar` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  UNIQUE KEY H_ID (H_ID)
  );";
 dbDelta( $sql ); 
 
 $table_name = $wpdb->prefix . "clickbar_clicks"; 
  //drop the exiting table if there is one
  $sql="DROP TABLE $table_name";
  $wpdb->query( $sql );
                                                                                        
  $sql = "CREATE TABLE IF NOT EXISTS $table_name (
  `C_ID` int(7) NOT NULL AUTO_INCREMENT,
  `DateX` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `ForBar` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  UNIQUE KEY C_ID (C_ID)
  );";
 dbDelta( $sql );   

?>