INSERT INTO `module` (`module_id`, `is_configurable`, `name`, `title`, `description`, `admin_uri`, `icon`, `maintainers`, `version`, `license`, `state`) VALUES ({SGL_NEXT_ID}, 1, 'productweb', 'Product', 'Generated by ModuleGenerationMgr', '', '48/module_default.png', 'Alouicious Bird', NULL, 'NULL', 'NULL');

SELECT @moduleId := MAX(module_id) FROM module;

#AdminArticleWebMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproductmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproductmgr_cmd_view', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproductmgr_cmd_addview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproductmgr_cmd_add', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproductmgr_cmd_editview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproductmgr_cmd_edit', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproductmgr_cmd_delete', '', @moduleId);

#AdminArticleWebTypeMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproducttypemgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproducttypemgr_cmd_view', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproducttypemgr_cmd_addview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproducttypemgr_cmd_add', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproducttypemgr_cmd_editview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproducttypemgr_cmd_edit', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminproducttypemgr_cmd_delete', '', @moduleId);

#ArticleViewWebMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'prductviewmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'prductviewmgr_cmd_viewarticle', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'prductviewmgr_cmd_viewarticletype', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'prductviewmgr_cmd_viewarticlealltype', '', @moduleId);

#member role perms


INSERT INTO `product_type` (`article_type_id`, `type_icon`) VALUES 
(1, ''),(2, ''),(3, ''),(4, '');


INSERT INTO `product_type_message` (`article_type_message_id`, `article_type_id`, `web_lang_id`, `type_name`, `description`) 
VALUES      (1, 1, 1, 'Gem Microscope', ''),(2, 2, 1, 'Biological', ''),(3, 3, 1, 'Import Microscope', ''),(4, 4, 1, 'Accessories', '');



INSERT INTO `product_type_role` (`article_type_id`, `role_id`) VALUES 
(1, 0),
(1, 1),
(1, 2),
(2, 0),
(2, 1),
(2, 2),
(3, 0),
(3, 1),
(3, 2),
(4, 0),
(4, 1),
(4, 2);