clear-data.sql 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. -- ----------------------------
  2. -- 清空日志表中数据
  3. -- ----------------------------
  4. truncate table `iot_alert_log`;
  5. truncate table `iot_device_log`;
  6. truncate table `iot_event_log`;
  7. truncate table `iot_function_log`;
  8. truncate table `iot_simulate_log`;
  9. truncate table `notify_log`;
  10. truncate table `sys_job_log`;
  11. truncate table `sys_logininfor`;
  12. truncate table `sys_oper_log`;
  13. truncate table iot_alert;
  14. truncate table iot_alert_log;
  15. truncate table iot_alert_notify_template;
  16. truncate table iot_alert_scene;
  17. truncate table iot_alert_trigger;
  18. truncate table iot_category;
  19. truncate table iot_device;
  20. truncate table iot_device_abnormal;
  21. truncate table iot_device_alert;
  22. truncate table iot_device_alert_user;
  23. truncate table iot_device_detail;
  24. truncate table iot_device_group;
  25. truncate table iot_device_history;
  26. truncate table iot_device_imgs;
  27. truncate table iot_device_inspection;
  28. truncate table iot_device_job;
  29. truncate table iot_device_lifecyle;
  30. truncate table iot_device_log;
  31. truncate table iot_device_log_buck;
  32. truncate table iot_device_maintain;
  33. truncate table iot_device_record;
  34. truncate table iot_device_share;
  35. truncate table iot_device_spare_part;
  36. truncate table iot_device_template;
  37. truncate table iot_device_user;
  38. truncate table iot_event_log;
  39. truncate table iot_firmware;
  40. truncate table iot_firmware_task;
  41. truncate table iot_firmware_task_detail;
  42. truncate table iot_function_log;
  43. truncate table iot_goview_project;
  44. truncate table iot_goview_project_data;
  45. truncate table iot_group;
  46. truncate table iot_group_user;
  47. truncate table iot_modbus_config;
  48. truncate table iot_modbus_job;
  49. truncate table iot_modbus_params;
  50. truncate table iot_product;
  51. truncate table iot_product_authorize;
  52. truncate table iot_product_copy1;
  53. truncate table iot_product_user;
  54. truncate table iot_scene;
  55. truncate table iot_scene_device;
  56. truncate table iot_scene_eneregy;
  57. truncate table iot_scene_maintainuser;
  58. truncate table iot_scene_operation;
  59. truncate table iot_scene_rule;
  60. truncate table iot_scene_rule_value;
  61. truncate table iot_scene_script;
  62. truncate table iot_scene_trigger;
  63. truncate table iot_script;
  64. truncate table iot_script_bridge;
  65. truncate table iot_script_user;
  66. truncate table iot_simulate_log;
  67. truncate table iot_sip_relation;
  68. truncate table iot_social_platform;
  69. truncate table iot_social_user;
  70. truncate table iot_sub_gateway;
  71. truncate table iot_things_model;
  72. truncate table iot_things_model_template;
  73. truncate table iot_things_model_template_translate;
  74. truncate table iot_things_model_translate;
  75. truncate table iot_var_temp;
  76. truncate table iot_var_temp_salve;
  77. delete from sys_role where role_id not in (1,2,3,4,5);
  78. delete from sys_user where user_id not in (1);
  79. delete from sys_role_dept where role_id not in (1,2,3,4,5);
  80. delete from sys_user_role where role_id not in (1,2,3,4,5);
  81. delete from sys_user_role where user_id not in (1);
  82. delete from sys_dept where dept_id not in (100, 101, 102);