INSERT INTO `pc_menu_groups` (`name`, `description`, `permission_code`, `is_active`, `order`, `url`, `created_by`, `created_date`, `updated_by`, `updated_date`, `code`) VALUES
('Curriculum Management', 'Curriculum Management', 'CURRICULUM_MANAGEMENT', '1', '1', '/cm', 0, UTC_TIMESTAMP(), 0, UTC_TIMESTAMP(), 'CURRICULUM_MANAGEMENT');

INSERT INTO `pc_menu_items` (`name`, `permission_code`, `order`, `description`, `is_active`, `parent_menu_item_id`, `url`, `created_by`, `created_date`, `updated_by`, `updated_date`, `code`) VALUES
('Curriculum', 'CREATE_CURRICULUM', '1', 'Curriculum', '1', NULL, 'curriculum', 0, UTC_TIMESTAMP(), 0, UTC_TIMESTAMP(), 'CURRICULUM');

INSERT INTO `pc_menu_items` (`name`, `permission_code`, `order`, `description`, `is_active`, `parent_menu_item_id`, `url`, `created_by`, `created_date`, `updated_by`, `updated_date`, `code`) VALUES
('Syllabus', 'CREATE_SYLLABUS', '2', 'Syllabus', '1', NULL, 'syllabus', 0, UTC_TIMESTAMP(), 0, UTC_TIMESTAMP(), 'SYLLABUS');


INSERT INTO `pc_product_variant_menu_groups` (`product_variant_id`, `pc_menu_group_id`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`) SELECT (SELECT id FROM product_variant WHERE name='AUTONOMOUS'),id,1,0,UTC_TIMESTAMP(),0,UTC_TIMESTAMP() FROM pc_menu_groups WHERE code='CURRICULUM_MANAGEMENT';

INSERT INTO `pc_product_variant_menu_group_items` (`product_variant_menu_group_id`, `pc_menu_item_id`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`) SELECT ppvmg.id,(SELECT id FROM pc_menu_items WHERE code='CURRICULUM'),1,0,UTC_TIMESTAMP(),0,UTC_TIMESTAMP() FROM pc_product_variant_menu_groups ppvmg INNER JOIN pc_menu_groups pmg ON ppvmg.pc_menu_group_id=pmg.id WHERE pmg.code='CURRICULUM_MANAGEMENT';

INSERT INTO `pc_product_variant_menu_group_items` (`product_variant_menu_group_id`, `pc_menu_item_id`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`) SELECT ppvmg.id,(SELECT id FROM pc_menu_items WHERE code='SYLLABUS'),1,0,UTC_TIMESTAMP(),0,UTC_TIMESTAMP() FROM pc_product_variant_menu_groups ppvmg INNER JOIN pc_menu_groups pmg ON ppvmg.pc_menu_group_id=pmg.id WHERE pmg.code='CURRICULUM_MANAGEMENT';


INSERT INTO `roles` (`name`, `code`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`) VALUES
('Staff', 'STAFF', '1', '0', UTC_TIMESTAMP(), '0', UTC_TIMESTAMP());


INSERT INTO `auth_permission` (`display_name`, `code`, `module`, `created_by`, `updated_by`) VALUES  ('Curriculum Management', 'CURRICULUM_MANAGEMENT', 'CURRICULUM', '0', '0'), ('Create Curriculum and assign departments', 'CREATE_CURRICULUM', 'CURRICULUM', '0', '0') ;

INSERT INTO `auth_permission` (`display_name`, `code`, `module`, `created_by`, `updated_by`) VALUES  ('Create and Edit Syllabus','CREATE_SYLLABUS','CURRICULUM','0','0') ;

-- INSERT INTO `user_account_roles` (`user_id`, `user_type`, `role_id`, `created_by`, `created_date`, `updated_by`, `updated_date`) VALUES
-- ('1', 'STAFF', '1', '0', '2020-08-05 16:46:34', '0', '2020-08-05 16:46:34');

-- INSERT INTO `auth_role_permissions` (`id`, `role_id`, `auth_permission_id`, `created_by`, `created_date`, `updated_by`, `updated_date`) VALUES
-- ('1', '1', '589', NULL, NULL, NULL, NULL),
-- ('2', '1', '590', NULL, NULL, NULL, NULL),
-- ('3', '1', '591', NULL, NULL, NULL, NULL);

-- INSERT INTO `auth_role_permissions` (`id`, `role_id`, `auth_permission_id`, `created_by`, `created_date`, `updated_by`, `updated_date`) VALUES
-- ('4', '1', '592', NULL, NULL, NULL, NULL),
-- ('5', '1', '593', NULL, NULL, NULL, NULL);