install.sql 1.8 KB

123456789101112131415161718192021222324252627282930313233
  1. SET @sName = 'bx_stripe_connect';
  2. -- TABLES
  3. CREATE TABLE IF NOT EXISTS `bx_stripe_connect_accounts` (
  4. `id` int(11) NOT NULL auto_increment,
  5. `added` int(11) NOT NULL default '0',
  6. `changed` int(11) NOT NULL default '0',
  7. `profile_id` int(11) NOT NULL default '0',
  8. `live_account_id` varchar(64) NOT NULL default '',
  9. `live_details` tinyint(4) NOT NULL default '0',
  10. `test_account_id` varchar(64) NOT NULL default '',
  11. `test_details` tinyint(4) NOT NULL default '0',
  12. PRIMARY KEY (`id`),
  13. UNIQUE KEY `profile_id` (`profile_id`),
  14. UNIQUE KEY `live_account_id` (`live_account_id`)
  15. );
  16. -- Logs Objects
  17. INSERT INTO `sys_objects_logs` (`object`, `module`, `logs_storage`, `title`, `active`, `class_name`, `class_file`) VALUES
  18. ('bx_stripe_connect', 'bx_stripe_connect', 'Auto', '_bx_stripe_connect_log', 1, '', '');
  19. -- Studio page and widget
  20. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  21. (3, @sName, '_bx_stripe_connect', '_bx_stripe_connect', 'bx_stripe_connect@modules/boonex/stripe_connect/|std-icon.svg');
  22. SET @iPageId = LAST_INSERT_ID();
  23. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  24. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  25. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  26. (@iPageId, @sName, 'integrations', '{url_studio}module.php?name=bx_stripe_connect', '', 'bx_stripe_connect@modules/boonex/stripe_connect/|std-icon.svg', '_bx_stripe_connect', '', '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";}');
  27. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  28. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));