disable.sql 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. -- SETTINGS
  2. SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_organizations' LIMIT 1);
  3. SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
  4. DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
  5. DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
  6. DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
  7. -- PAGES
  8. DELETE FROM `sys_objects_page` WHERE `module` = 'bx_organizations';
  9. DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_organizations' OR `object` IN('bx_organizations_create_profile', 'bx_organizations_delete_profile', 'bx_organizations_edit_profile', 'bx_organizations_edit_profile_cover', 'bx_organizations_invite', 'bx_organizations_view_profile', 'bx_organizations_view_profile_closed', 'bx_organizations_profile_info', 'bx_organizations_fans', 'bx_organizations_profile_friends', 'bx_organizations_friend_requests', 'bx_organizations_profile_favorites', 'bx_organizations_profile_subscriptions', 'bx_organizations_profile_comments', 'bx_organizations_home', 'bx_organizations_search', 'bx_organizations_manage', 'bx_organizations_joined');
  10. -- MENU
  11. DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_organizations';
  12. DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_organizations';
  13. DELETE FROM `sys_menu_items` WHERE `module` = 'bx_organizations' OR `set_name` IN('bx_organizations_view_submenu', 'bx_organizations_submenu', 'bx_organizations_view_actions', 'bx_organizations_view_actions_more', 'bx_organizations_snippet_meta');
  14. -- ACL
  15. DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_organizations';
  16. DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_organizations';
  17. -- COMMENTS
  18. DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_organizations';
  19. -- VIEWS
  20. DELETE FROM `sys_objects_view` WHERE `name` = 'bx_organizations';
  21. -- REPORTS
  22. DELETE FROM `sys_objects_report` WHERE `name` = 'bx_organizations';
  23. -- FAFORITES
  24. DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_organizations';
  25. -- FEATURED
  26. DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_organizations';
  27. -- METATAGS
  28. DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_organizations';
  29. -- CATEGORY
  30. DELETE FROM `sys_objects_category` WHERE `object` = 'bx_organizations_cats';
  31. -- SEARCH
  32. DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_organizations', 'bx_organizations_cmts');
  33. -- CONNECTIONS
  34. DELETE FROM `sys_objects_connection` WHERE `object` = 'bx_organizations_fans';
  35. -- STATS
  36. DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_organizations%';
  37. -- CHARTS
  38. DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_organizations%';
  39. -- GRIDS
  40. DELETE FROM `sys_objects_grid` WHERE `object` LIKE 'bx_organizations%';
  41. DELETE FROM `sys_grid_fields` WHERE `object` LIKE 'bx_organizations%';
  42. DELETE FROM `sys_grid_actions` WHERE `object` LIKE 'bx_organizations%';
  43. -- LIVE UPDATES
  44. DELETE FROM `sys_objects_live_updates` WHERE `name` = 'bx_organizations_friend_requests';
  45. -- ALERTS
  46. SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_organizations' LIMIT 1);
  47. DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
  48. DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
  49. -- PRIVACY
  50. DELETE FROM `sys_objects_privacy` WHERE `object` IN('bx_organizations_allow_view_to', 'bx_organizations_allow_view_notification_to');
  51. -- EMAIL TEMPLATES
  52. DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_organizations';
  53. -- UPLOADERS
  54. DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_organizations_cover_crop', 'bx_organizations_picture_crop');