
RENAME TABLE `user_benificiaries` TO `viserbank`.`user_beneficiaries`;
ALTER TABLE `user_beneficiaries` CHANGE `benificiary_id` `beneficiary_id` INT(10) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `user_actions` CHANGE `benificiary_id` `beneficiary_id` INT(10) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `balance_transfers` CHANGE `benificiary_id` `beneficiary_id` INT(10) UNSIGNED NOT NULL;


UPDATE `general_settings` SET `modules` = '{"deposit":1,"withdraw":1,"dps":1,"fdr":1,"loan":1,"own_bank":1,"other_bank":1,"otp_email":1,"otp_sms":0,"referral_system":0,"kyc":0}' WHERE `id` = 1;

ALTER TABLE `general_settings` ADD `kyc_form` TEXT NULL DEFAULT NULL AFTER `modules`;

ALTER TABLE `users` ADD `kyc_data` TEXT NULL COMMENT 'KYC Form Data' AFTER `status`, ADD `kycv` TINYINT NOT NULL DEFAULT '1' COMMENT 'KYC Verified' AFTER `kyc_data`;


INSERT INTO `email_sms_templates` (`id`, `act`, `name`, `subj`, `email_body`, `sms_body`, `shortcodes`, `email_status`, `sms_status`, `created_at`, `updated_at`) VALUES (NULL, 'KYC_APPROVE', 'KYC Verification Approved', 'KYC Verification Approved', 'Congratulations your documents for KYC verification are approved.', 'Congratulations your documents for KYC verification are approved.', '{\r\n \"sitename\" : \"Site Name\"\r\n}', '1', '1', '2021-07-11 09:21:19', '2021-07-28 17:24:04');

INSERT INTO `email_sms_templates` (`id`, `act`, `name`, `subj`, `email_body`, `sms_body`, `shortcodes`, `email_status`, `sms_status`, `created_at`, `updated_at`) VALUES (NULL, 'KYC_REJECT', 'KYC Verification Rejected', 'KYC Verification Rejected', 'Sorry your documents for KYC verification are rejected.', 'Sorry your documents for KYC verification are rejected.', '{\r\n \"sitename\" : \"Site Name\"\r\n}', '1', '1', '2021-07-11 09:21:19', '2021-07-28 17:24:04');

CREATE TABLE `referrals` ( `id` int(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, `commission_type` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `level` int(11) NOT NULL, `percent` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `email_sms_templates` (`id`, `act`, `name`, `subj`, `email_body`, `sms_body`, `shortcodes`, `email_status`, `sms_status`, `created_at`, `updated_at`) VALUES
(NULL, 'REFERRAL_COMMISSION', 'REFERRAL COMMISSION', 'REFERRAL COMMISSION', 'Congratulation, You you  {{amount}} {{currency}} interest And your main balance {{main_balance}} {{currency}} . {{level}} . Transaction {{trx}}', 'Congratulation, You you  {{amount}} {{currency}} interest And your main balance {{main_balance}} {{currency}} . {{level}} . Transaction {{trx}}', '{\"amount\":\"amount\",\"main_balance\":\"main balance\",\"trx\":\"transaction\",\"level\":\"level\",\"currency\":\"currency\"}', 1, 1, '2019-09-14 19:14:22', '2019-11-10 09:07:12');


CREATE TABLE `commission_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `from_id` int(11) DEFAULT NULL,
  `to_id` int(11) DEFAULT NULL,
  `level` int(11) DEFAULT NULL,
  `commission_amount` decimal(18,8) NOT NULL DEFAULT 0.00000000,
  `main_amo` decimal(18,8) DEFAULT 0.00000000,
  `trx_amo` decimal(18,8) NOT NULL DEFAULT 0.00000000,
  `percent` decimal(11,2) NOT NULL DEFAULT 0.00,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trx` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


ALTER TABLE `commission_logs`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `commission_logs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;


