ALTER TABLE `admin`  ADD `permission` LONGTEXT NOT NULL  AFTER `default_login`;

ALTER TABLE `currency` CHANGE `currency_code` `currency_code` CHAR(6) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;

INSERT INTO `currency` (`currency_id`, `currency_name`, `currency_code`, `currency_symbol`, `currency_decimal_place`, `currency_status`, `currency_dateCreated`) VALUES (NULL, 'Token', 'TRX', 'TRX', '2', '1', current_timestamp());

ALTER TABLE `deposit`  ADD `wallet_address` LONGTEXT NULL  AFTER `deposit_amount`,  ADD `private_key` LONGTEXT NULL  AFTER `wallet_address`,  ADD `public_key` LONGTEXT NULL  AFTER `private_key`,  ADD `address_hex` LONGTEXT NULL  AFTER `public_key`;

ALTER TABLE `matches`  ADD `match_private_desc` TEXT NOT NULL  AFTER `match_desc`;

ALTER TABLE `matches` CHANGE `match_status` `match_status` ENUM('0','1','2','3','4') CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '1' COMMENT '0=deactive,1=active,2 =complete,3 = start,4=cancel';

ALTER TABLE `member`  ADD `profile_image` TEXT NOT NULL  AFTER `new_user`,ADD `user_template` VARCHAR(20) NOT NULL DEFAULT 'bmuserapp'  AFTER `profile_image`;

ALTER TABLE `page`  ADD `add_to_footer` ENUM('0','1') NOT NULL  AFTER `add_to_menu`;

ALTER TABLE `pg_detail` CHANGE `wname` `wname` LONGTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, CHANGE `name` `name` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;

ALTER TABLE `matches` DROP `version`;

CREATE TABLE `permission` (
  `permission_id` int(10) NOT NULL,
  `name` varchar(100) NOT NULL,
  `code_name` varchar(100) NOT NULL,
  `parent_status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



ALTER TABLE `permission`
  ADD PRIMARY KEY (`permission_id`);

ALTER TABLE `permission`
  MODIFY `permission_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=85;

INSERT INTO `web_config` (`id`, `web_config_name`, `web_config_value`) VALUES (NULL, 'timezone', 'Asia/Kolkata'), (NULL, 'supported_language', '{\"en\":\"english\",\"ar\":\"arabic\"}'),(NULL, 'rtl_supported_language', '{\"ar\":\"arabic\",\"arc\":\"aramaic\",\"dv\":\"divehi\",\"fa\":\"persian\",\"ha\":\"hausa\",\"he\":\"hebrew\",\"khw\":\"khowar\",\"ks\":\"kashmiri\",\"ku\":\"kurdish\",\"ps\":\"pashto\",\"ur\":\"urdu\",\"yi\":\"yiddish\"}'),(NULL, 'footer_script', ''),(NULL, 'firebase_script', '');

INSERT INTO `pg_detail` (`id`, `payment_name`, `payment_description`, `payment_status`, `name`, `mid`, `mkey`, `wname`, `itype`, `currency`, `currency_point`, `date`, `status`, `created_date`) VALUES (NULL, 'Tron', '', '', '', '', '', '', '', '6', '1', '', '0', current_timestamp()), (NULL, 'PayU', '', '', '', '', '', '', '', '2', '1', '', '0', current_timestamp());

ALTER TABLE `accountstatement` CHANGE `accountstatement_dateCreated` `accountstatement_dateCreated` DATETIME NOT NULL;

ALTER TABLE `admin` CHANGE `craeted_date` `craeted_date` DATETIME NOT NULL;

ALTER TABLE `announcement` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `banner` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `country` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `courier` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `currency` CHANGE `currency_dateCreated` `currency_dateCreated` DATETIME NOT NULL;

ALTER TABLE `deposit` CHANGE `deposit_dateCreated` `deposit_dateCreated` DATETIME NOT NULL;

ALTER TABLE `features_tab` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `features_tab_content` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `game` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `howtoplay_content` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `image` CHANGE `created_date` `created_date` DATETIME NOT NULL;

ALTER TABLE `lottery` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `lottery_member` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `matches` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `match_join_member` CHANGE `date_craeted` `date_craeted` DATETIME NOT NULL;

ALTER TABLE `member` CHANGE `created_date` `created_date` DATETIME NOT NULL;

ALTER TABLE `orders` CHANGE `created_date` `created_date` DATETIME NOT NULL;

ALTER TABLE `pg_detail` CHANGE `created_date` `created_date` DATETIME NOT NULL;

ALTER TABLE `product` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `referral` CHANGE `referral_dateCreated` `referral_dateCreated` DATETIME NOT NULL;

ALTER TABLE `screenshots` CHANGE `created_date` `created_date` DATETIME NOT NULL;

ALTER TABLE `slider` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `watch_earn` CHANGE `date_created` `date_created` DATETIME NOT NULL;

ALTER TABLE `withdraw_method` CHANGE `withdraw_method_dateCreated` `withdraw_method_dateCreated` DATETIME NOT NULL;

ALTER TABLE `youtube_link` CHANGE `date_created` `date_created` DATETIME NOT NULL;

UPDATE `pg_detail` SET `status` = '0' where id != '3';

UPDATE `pg_detail` SET `currency` = '3',`currency_point` = '1' WHERE `pg_detail`.`id` = 3;