CREATE TABLE ohrm_license_details (id  INT NOT NULL AUTO_INCREMENT, content MEDIUMTEXT NOT NULL, PRIMARY KEY (`id`)) engine=innodb default charset=utf8;

INSERT INTO `ohrm_module`(`name`, `status`) VALUES ('license', '1');
SET @module_id := (SELECT LAST_INSERT_ID()); 

INSERT INTO ohrm_screen (`name`, `module_id`, `action_url`, `route_name`) VALUES('License Update', @module_id, 'addLicense', 'license_addLicense');
SET @addLicense_screen_id := (SELECT LAST_INSERT_ID());

SET @system_administration_menu_id = (SELECT `id` FROM ohrm_menu_item WHERE `menu_title` = 'System Administration' AND parent_id IS NULL AND level = 1);
SET @management_tools_menu_id = (SELECT `id` FROM ohrm_menu_item WHERE `menu_title` = 'Management Tools' AND `parent_id` = @system_administration_menu_id);

INSERT INTO ohrm_menu_item (`menu_title`, `screen_id`, `parent_id`, `level`, `order_hint`, `url_extras`, `status`) VALUES
('License Update',@addLicense_screen_id , @management_tools_menu_id, 3, 900, '', 1);
SET @licenseUpload_menu_id :=(SELECT LAST_INSERT_ID());
SET @config_admin_role_id := (SELECT `id` FROM ohrm_user_role WHERE `name` = 'ConfigAdmin');
INSERT INTO `ohrm_user_role_screen` (`user_role_id`, `screen_id`, `can_read`, `can_create`, `can_update`, `can_delete`) VALUES (@config_admin_role_id, @addLicense_screen_id, '1', '1', '1', '1');

