CREATE TABLE `ohrm_integration_flow_type` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`is_to_date_required` tinyint(1) NOT NULL DEFAULT 0,
`enable` tinyint(1) NOT NULL DEFAULT 1,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `ohrm_integration_flow_type` (`id`, `name`, `is_to_date_required`, `enable`) VALUES
 (1, 'Employee Data Flow', 0, 1),
 (2, 'Leave Data Flow', 1, 1);

ALTER TABLE `ohrm_external_integration_flow` ADD `flow_type_id` INT(11) NULL DEFAULT NULL AFTER `external_vendor_id`;
ALTER TABLE `ohrm_external_integration_flow` ADD CONSTRAINT `fk_ohrm_flow_type` FOREIGN KEY (`flow_type_id`) REFERENCES `ohrm_integration_flow_type`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
