ALTER TABLE `tblstaff` ADD `comet_chat_uid` VARCHAR(191) NULL DEFAULT NULL AFTER `staffid`, ADD INDEX (`comet_chat_uid`);

INSERT INTO `tblplan_features` (`id`, `name`, `codename`, `description`, `type`, `added_on`) VALUES (NULL, 'Team Chat', 'team_chat_module', 'team_chat_module', 'allow', UTC_TIMESTAMP());

INSERT INTO `tblplan_features_value` (`id`, `plans_id`, `plans_features_id`, `value`, `other_data`, `added_on`) VALUES (NULL, '9', '76', '0', '', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`id`, `plans_id`, `plans_features_id`, `value`, `other_data`, `added_on`) VALUES (NULL, '10', '76', '0', '', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`id`, `plans_id`, `plans_features_id`, `value`, `other_data`, `added_on`) VALUES (NULL, '11', '76', '1', '', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`id`, `plans_id`, `plans_features_id`, `value`, `other_data`, `added_on`) VALUES (NULL, '12', '76', '1', '', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`id`, `plans_id`, `plans_features_id`, `value`, `other_data`, `added_on`) VALUES (NULL, '13', '76', '0', '', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`id`, `plans_id`, `plans_features_id`, `value`, `other_data`, `added_on`) VALUES (NULL, '14', '76', '0', '', UTC_TIMESTAMP());

ALTER TABLE `tbltrial_details` ADD `plans` VARCHAR(500) NULL DEFAULT NULL COMMENT 'Trial is allowed only in these plans' AFTER `module`;

INSERT INTO `tbltrial_details` (`id`, `module`, `plans`,`no_of_trial_days`, `module_live_date`, `details`, `addedon`) VALUES (NULL, 'team_chat_module', '[10,13,14]', '15', '2021-07-01', '{\"trial_active_details\":{\"icon\":\"assets\\/images\\/trial_icons\\/trial_active.png\",\"title\":\"Team Chat (Trial)\",\"description\":\"Team Chat is a Corporate feature. You have {no_of_trial_days_left} left on your free trial, after that, you\'ll need to choose a plan.\",\"button_text\":\"UPGRADE PLAN\"},\"trial_expired_detials\":{\"icon\":\"assets\\/images\\/trial_icons\\/trial_expired.png\",\"title\":\"Trial Expired!\",\"description\":\"Your trial of Team Chat has expired. To continue using the team chat, upgrade your plan now.\",\"button_text\":\"UPGRADE PLAN\"}}', '2021-07-01');

INSERT INTO `tblstaff_permissions`(`tenant_id`, `staff_id`, `feature`, `capability`) SELECT tenant_id, staffid, 'team_chat_module', 'create_group_chat' FROM tblstaff WHERE is_tenant = 0 AND tenant_id IN (SELECT id FROM tbltenants WHERE pro_plan_id != 9);