disable.sql 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. -- SETTINGS
  2. SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_persons' 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. -- STORAGES & TRANSCODERS
  8. DELETE FROM `sys_objects_storage` WHERE `object` IN('bx_persons_pictures', 'bx_persons_pictures_resized');
  9. DELETE FROM `sys_storage_tokens` WHERE `object` IN('bx_persons_pictures', 'bx_persons_pictures_resized');
  10. DELETE FROM `sys_objects_transcoder_images` WHERE `object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb');
  11. DELETE FROM `sys_transcoder_images_filters` WHERE `transcoder_object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb');
  12. DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb');
  13. -- TODO: delete resized picture files as well
  14. TRUNCATE TABLE `bx_persons_pictures_resized`;
  15. -- PAGES
  16. DELETE FROM `sys_objects_page` WHERE `module` = 'bx_persons';
  17. DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_persons' OR `object` IN('bx_persons_create_profile', 'bx_persons_delete_profile', 'bx_persons_edit_profile', 'bx_persons_edit_profile_cover', 'bx_persons_view_profile', 'bx_persons_profile_info', 'bx_persons_profile_friends', 'bx_persons_home');
  18. -- MENU
  19. DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_persons';
  20. DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_persons';
  21. DELETE FROM `sys_menu_items` WHERE `module` = 'bx_persons' OR `set_name` IN('bx_persons_view_submenu', 'bx_persons_submenu', 'bx_persons_view_actions', 'bx_persons_view_actions_more');
  22. -- ACL
  23. 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_persons';
  24. DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_persons';
  25. -- VIEWS
  26. DELETE FROM `sys_objects_view` WHERE `Name`='bx_persons';