ALTER TABLE `tblcustomfields` 
ADD COLUMN `is_transferable` TINYINT(1) NOT NULL DEFAULT 0 AFTER `bs_column`,
ADD COLUMN `default_value` TEXT NULL DEFAULT NULL AFTER `is_transferable`,
ADD COLUMN `parent_id` BIGINT(20) NULL DEFAULT NULL AFTER `default_value`;



INSERT INTO `tblplan_features` (`name`, `codename`, `description`, `type`, `added_on`) VALUES ('Custom Field', 'custom_field', 'Custom Field', 'restrict', NOW());
SET @custom_field_id = LAST_INSERT_ID();
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('9', @custom_field_id, '0', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('10', @custom_field_id, '0', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('11', @custom_field_id, '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('12', @custom_field_id, '1', UTC_TIMESTAMP());

UPDATE tblstaff SET refresh_permissions = 1;

ALTER TABLE `tblcustomfieldsvalues` CHANGE `fieldto` `fieldto` VARCHAR(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `tblcustomfields` CHANGE `fieldto` `fieldto` VARCHAR(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
