ALTER TABLE `tblclients` ADD `client_type` ENUM('business','individual','','') NOT NULL AFTER `userid`;
UPDATE `tblclients` SET `client_type`='individual' WHERE company is null
UPDATE `tblclients` SET `client_type`='business' WHERE company is not null;

ALTER TABLE `tblcontacts_other_details` ADD `phonenumber_code` VARCHAR(6) NULL AFTER `field_type`;
ALTER TABLE `tblcontacts` CHANGE `firstname` `firstname` VARCHAR(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
ALTER TABLE `tblcontacts_other_details` ADD `contact_id` BIGINT(20) NOT NULL AFTER `client_id`;
UPDATE tblcontacts_other_details a join tblcontacts b on a.tenant_id = b.tenant_id and a.client_id = b.userid SET a.contact_id = b.id where a.tenant_id = b.tenant_id and a.client_id = b.userid;


ALTER TABLE `tblleads` ADD `phonenumber_code` VARCHAR(6) NULL AFTER `phonenumber_type`;
ALTER TABLE `tblleads_other_details` ADD `phonenumber_code` VARCHAR(6) NULL AFTER `field_type`;