ALTER TABLE `tblsms_templates_static` CHANGE `type` `type` ENUM('estimate','invoice','post_inspection','business_review','client_referral');
ALTER TABLE `tblsms_templates` CHANGE `type` `type` ENUM('estimate','invoice','post_inspection','business_review','client_referral');
INSERT INTO tblsms_templates_static values (null, 'client_referral', 'Hi {contact_firstname},  just wanted to let you know that we have a referral program. We’ll pay you {offer_amount} for every customer you refer to {companyname}.Thanks for everything!');
INSERT INTO tblsms_templates  SELECT NULL, id,'client_referral', 'Hi {contact_firstname},  just wanted to let you know that we have a referral program. We’ll pay you {offer_amount} for every customer you refer to {companyname}.Thanks for everything!', now(), now() FROM tbltenants;
INSERT INTO tblemailtemplates  SELECT id, null,'client_referral', 'client-referral', 'english', 'Client referral program', '{companyname}’s referral program', '<span style=\"font-size: 12pt;\">Hi {client_firstname},</span><br /><br /><span style=\"font-size: 12pt;\">I wanted to let you know about our referral program. We’ll give you {offer_amount} for each and every customer you send our way.</span><br /><br /><span style=\"font-size: 12pt;\"> Anytime you hear someone mention they need work done, tell them about us and when they let us know you sent them our way, we will cut you a {offer_amount} check.</span><br /><span style=\"font-size: 12pt;\">If you have any questions, let me know.</span><br /><br />Thanks for everything!<br /><br /><span style=\"font-size: 12pt;\">{authorize_signature}</span>', '{tenant_name}', NULL, '0', '1', '0',0,0 FROM tbltenants;
insert into tblemailtemplates_static values (null,'client_referral', 'client-referral', 'english', 'Client referral program', '{companyname}’s referral program', '<span style=\"font-size: 12pt;\">Hi {client_firstname},</span><br /><br /><span style=\"font-size: 12pt;\">I wanted to let you know about our referral program. We’ll give you {offer_amount} for each and every customer you send our way.</span><br /><br /><span style=\"font-size: 12pt;\"> Anytime you hear someone mention they need work done, tell them about us and when they let us know you sent them our way, we will cut you a {offer_amount} check.</span><br /><span style=\"font-size: 12pt;\">If you have any questions, let me know.</span><br /><br />Thanks for everything!<br /><br /><span style=\"font-size: 12pt;\">{authorize_signature}</span>', ' {tenant_name}', NULL, '0', '1', '0');

ALTER TABLE `tbljobs` 
ADD COLUMN `status_updated_on` DATETIME NULL DEFAULT NULL AFTER `status`;

INSERT INTO `tblplan_features` (`name`, `codename`, `description`, `type`, `added_on`) VALUES ('Client Referral', 'client_referral', 'Client Referrral', 'restrict', NOW());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('1', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('2', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('3', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('4', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('5', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('6', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('7', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('8', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('9', '78', '0', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('10', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('11', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('12', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('13', '78', '1', '2021-08-25 12:20:12');
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('14', '78', '1', '2021-08-25 12:20:12');