disable.sql 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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', 'bx_persons_pictures_covers');
  9. DELETE FROM `sys_storage_tokens` WHERE `object` IN('bx_persons_pictures', 'bx_persons_pictures_resized', 'bx_persons_pictures_covers');
  10. DELETE FROM `sys_objects_transcoder_images` WHERE `object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_preview', '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_preview', '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_preview', 'bx_persons_cover', 'bx_persons_cover_thumb');
  13. -- TODO: delete resized picture files as well
  14. TRUNCATE TABLE `bx_persons_pictures_resized`;
  15. -- UPLOADERS
  16. DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_persons_avatar', 'bx_persons_cover');
  17. -- PAGES
  18. DELETE FROM `sys_objects_page` WHERE `module` = 'bx_persons';
  19. 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_view_profile', 'bx_persons_profile_info');
  20. -- MENU
  21. DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_persons';
  22. DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_persons';
  23. DELETE FROM `sys_menu_items` WHERE `module` = 'bx_persons' OR `set_name` IN('bx_persons_view', 'bx_persons_view_submenu');
  24. -- ACL
  25. 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';
  26. DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_persons';