install.sql 1.4 KB

12345678910111213141516171819202122232425
  1. SET @sName = 'bx_market_api';
  2. -- TABLE: licenses
  3. CREATE TABLE IF NOT EXISTS `bx_market_api_licenses` (
  4. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  5. `license_id` int(11) unsigned NOT NULL default '0',
  6. `profile_id` int(11) unsigned NOT NULL default '0',
  7. `type` varchar(16) collate utf8_unicode_ci NOT NULL default '',
  8. PRIMARY KEY (`id`),
  9. UNIQUE KEY `license_id` (`license_id`)
  10. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  11. -- STUDIO: page & widget
  12. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  13. (3, @sName, '_bx_market_api', '_bx_market_api', 'bx_market_api@modules/boonex/market_api/|std-pi.png');
  14. SET @iPageId = LAST_INSERT_ID();
  15. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  16. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  17. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  18. (@iPageId, @sName, '{url_studio}module.php?name=bx_market_api', '', 'bx_market_api@modules/boonex/market_api/|std-wi.png', '_bx_market_api', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
  19. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  20. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));