Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.07 KB | None | 0 0
  1. SET FOREIGN_KEY_CHECKS = 0;
  2.  
  3. #Truncate order tables
  4.  
  5. TRUNCATE TABLE `gift_message`;
  6. TRUNCATE TABLE `quote`;
  7. TRUNCATE TABLE `quote_address`;
  8. TRUNCATE TABLE `quote_address_item`;
  9. TRUNCATE TABLE `quote_id_mask`;
  10. TRUNCATE TABLE `quote_item`;
  11. TRUNCATE TABLE `quote_item_option`;
  12. TRUNCATE TABLE `quote_payment`;
  13. TRUNCATE TABLE `quote_shipping_rate`;
  14. TRUNCATE TABLE `reporting_orders`;
  15. TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
  16. TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
  17. TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;
  18. TRUNCATE TABLE `sales_creditmemo`;
  19. TRUNCATE TABLE `sales_creditmemo_comment`;
  20. TRUNCATE TABLE `sales_creditmemo_grid`;
  21. TRUNCATE TABLE `sales_creditmemo_item`;
  22. TRUNCATE TABLE `sales_invoice`;
  23. TRUNCATE TABLE `sales_invoiced_aggregated`;
  24. TRUNCATE TABLE `sales_invoiced_aggregated_order`;
  25. TRUNCATE TABLE `sales_invoice_comment`;
  26. TRUNCATE TABLE `sales_invoice_grid`;
  27. TRUNCATE TABLE `sales_invoice_item`;
  28. TRUNCATE TABLE `sales_order`;
  29. TRUNCATE TABLE `sales_order_address`;
  30. TRUNCATE TABLE `sales_order_aggregated_created`;
  31. TRUNCATE TABLE `sales_order_aggregated_updated`;
  32. TRUNCATE TABLE `sales_order_grid`;
  33. TRUNCATE TABLE `sales_order_item`;
  34. TRUNCATE TABLE `sales_order_payment`;
  35. TRUNCATE TABLE `sales_order_status_history`;
  36. TRUNCATE TABLE `sales_order_tax`;
  37. TRUNCATE TABLE `sales_order_tax_item`;
  38. TRUNCATE TABLE `sales_payment_transaction`;
  39. TRUNCATE TABLE `sales_refunded_aggregated`;
  40. TRUNCATE TABLE `sales_refunded_aggregated_order`;
  41. TRUNCATE TABLE `sales_shipment`;
  42. TRUNCATE TABLE `sales_shipment_comment`;
  43. TRUNCATE TABLE `sales_shipment_grid`;
  44. TRUNCATE TABLE `sales_shipment_item`;
  45. TRUNCATE TABLE `sales_shipment_track`;
  46. TRUNCATE TABLE `sales_shipping_aggregated`;
  47. TRUNCATE TABLE `sales_shipping_aggregated_order`;
  48. TRUNCATE TABLE `tax_order_aggregated_created`;
  49. TRUNCATE TABLE `tax_order_aggregated_updated`;
  50.  
  51. #Truncate Customer tables
  52.  
  53. TRUNCATE TABLE `customer_address_entity`;
  54. TRUNCATE TABLE `customer_address_entity_datetime`;
  55. TRUNCATE TABLE `customer_address_entity_decimal`;
  56. TRUNCATE TABLE `customer_address_entity_int`;
  57. TRUNCATE TABLE `customer_address_entity_text`;
  58. TRUNCATE TABLE `customer_address_entity_varchar`;
  59. TRUNCATE TABLE `customer_entity`;
  60. TRUNCATE TABLE `customer_entity_datetime`;
  61. TRUNCATE TABLE `customer_entity_decimal`;
  62. TRUNCATE TABLE `customer_entity_int`;
  63. TRUNCATE TABLE `customer_entity_text`;
  64. TRUNCATE TABLE `customer_entity_varchar`;
  65. TRUNCATE TABLE `customer_grid_flat`;
  66. TRUNCATE TABLE `customer_log`;
  67. TRUNCATE TABLE `customer_log`;
  68. TRUNCATE TABLE `customer_visitor`;
  69. TRUNCATE TABLE `persistent_session`;
  70. TRUNCATE TABLE `wishlist`;
  71. TRUNCATE TABLE `wishlist_item`;
  72. TRUNCATE TABLE `wishlist_item_option`;
  73.  
  74. #Truncate Review tables
  75.  
  76. TRUNCATE TABLE `review`;
  77. TRUNCATE TABLE `review_detail`;
  78. TRUNCATE TABLE `review_entity_summary`;
  79. TRUNCATE TABLE `review_store`;
  80.  
  81. #Truncate Product tables
  82.  
  83. TRUNCATE TABLE `cataloginventory_stock_item`;
  84. TRUNCATE TABLE `cataloginventory_stock_status`;
  85. TRUNCATE TABLE `cataloginventory_stock_status_idx`;
  86. TRUNCATE TABLE `cataloginventory_stock_status_tmp`;
  87. TRUNCATE TABLE `catalog_category_product`;
  88. TRUNCATE TABLE `catalog_category_product_index`;
  89. TRUNCATE TABLE `catalog_category_product_index_tmp`;
  90. TRUNCATE TABLE `catalog_compare_item`;
  91. TRUNCATE TABLE `catalog_product_bundle_option`;
  92. TRUNCATE TABLE `catalog_product_bundle_option_value`;
  93. TRUNCATE TABLE `catalog_product_bundle_price_index`;
  94. TRUNCATE TABLE `catalog_product_bundle_selection`;
  95. TRUNCATE TABLE `catalog_product_bundle_selection_price`;
  96. TRUNCATE TABLE `catalog_product_bundle_stock_index`;
  97. TRUNCATE TABLE `catalog_product_entity`;
  98. TRUNCATE TABLE `catalog_product_entity_datetime`;
  99. TRUNCATE TABLE `catalog_product_entity_decimal`;
  100. TRUNCATE TABLE `catalog_product_entity_gallery`;
  101. TRUNCATE TABLE `catalog_product_entity_int`;
  102. TRUNCATE TABLE `catalog_product_entity_media_gallery`;
  103. TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
  104. TRUNCATE TABLE `catalog_product_entity_media_gallery_value_to_entity`;
  105. TRUNCATE TABLE `catalog_product_entity_media_gallery_value_video`;
  106. TRUNCATE TABLE `catalog_product_entity_text`;
  107. TRUNCATE TABLE `catalog_product_entity_tier_price`;
  108. TRUNCATE TABLE `catalog_product_entity_varchar`;
  109. TRUNCATE TABLE `catalog_product_index_eav`;
  110. TRUNCATE TABLE `catalog_product_index_eav_decimal`;
  111. TRUNCATE TABLE `catalog_product_index_eav_decimal_idx`;
  112. TRUNCATE TABLE `catalog_product_index_eav_decimal_tmp`;
  113. TRUNCATE TABLE `catalog_product_index_eav_idx`;
  114. TRUNCATE TABLE `catalog_product_index_eav_tmp`;
  115. TRUNCATE TABLE `catalog_product_index_price`;
  116. TRUNCATE TABLE `catalog_product_index_price_bundle_idx`;
  117. TRUNCATE TABLE `catalog_product_index_price_bundle_opt_idx`;
  118. TRUNCATE TABLE `catalog_product_index_price_bundle_opt_tmp`;
  119. TRUNCATE TABLE `catalog_product_index_price_bundle_sel_idx`;
  120. TRUNCATE TABLE `catalog_product_index_price_bundle_sel_tmp`;
  121. TRUNCATE TABLE `catalog_product_index_price_bundle_tmp`;
  122. TRUNCATE TABLE `catalog_product_index_price_cfg_opt_agr_idx`;
  123. TRUNCATE TABLE `catalog_product_index_price_cfg_opt_agr_tmp`;
  124. TRUNCATE TABLE `catalog_product_index_price_cfg_opt_idx`;
  125. TRUNCATE TABLE `catalog_product_index_price_cfg_opt_tmp`;
  126. TRUNCATE TABLE `catalog_product_index_price_downlod_idx`;
  127. TRUNCATE TABLE `catalog_product_index_price_downlod_tmp`;
  128. TRUNCATE TABLE `catalog_product_index_price_final_idx`;
  129. TRUNCATE TABLE `catalog_product_index_price_final_tmp`;
  130. TRUNCATE TABLE `catalog_product_index_price_idx`;
  131. TRUNCATE TABLE `catalog_product_index_price_opt_agr_idx`;
  132. TRUNCATE TABLE `catalog_product_index_price_opt_agr_tmp`;
  133. TRUNCATE TABLE `catalog_product_index_price_opt_idx`;
  134. TRUNCATE TABLE `catalog_product_index_price_opt_tmp`;
  135. TRUNCATE TABLE `catalog_product_index_price_tmp`;
  136. TRUNCATE TABLE `catalog_product_index_tier_price`;
  137. TRUNCATE TABLE `catalog_product_index_website`;
  138. TRUNCATE TABLE `catalog_product_link`;
  139. TRUNCATE TABLE `catalog_product_link_attribute_decimal`;
  140. TRUNCATE TABLE `catalog_product_link_attribute_int`;
  141. TRUNCATE TABLE `catalog_product_link_attribute_varchar`;
  142. TRUNCATE TABLE `catalog_product_option`;
  143. TRUNCATE TABLE `catalog_product_option_price`;
  144. TRUNCATE TABLE `catalog_product_option_title`;
  145. TRUNCATE TABLE `catalog_product_option_type_price`;
  146. TRUNCATE TABLE `catalog_product_option_type_title`;
  147. TRUNCATE TABLE `catalog_product_option_type_value`;
  148. TRUNCATE TABLE `catalog_product_relation`;
  149. TRUNCATE TABLE `catalog_product_super_attribute`;
  150. TRUNCATE TABLE `catalog_product_super_attribute_label`;
  151. TRUNCATE TABLE `catalog_product_super_link`;
  152. TRUNCATE TABLE `catalog_product_website`;
  153. TRUNCATE TABLE `catalog_url_rewrite_product_category`;
  154. TRUNCATE TABLE `downloadable_link`;
  155. TRUNCATE TABLE `downloadable_link_price`;
  156. TRUNCATE TABLE `downloadable_link_purchased`;
  157. TRUNCATE TABLE `downloadable_link_purchased_item`;
  158. TRUNCATE TABLE `downloadable_link_title`;
  159. TRUNCATE TABLE `downloadable_sample`;
  160. TRUNCATE TABLE `downloadable_sample_title`;
  161. TRUNCATE TABLE `product_alert_price`;
  162. TRUNCATE TABLE `product_alert_stock`;
  163. TRUNCATE TABLE `report_compared_product_index`;
  164. TRUNCATE TABLE `report_viewed_product_aggregated_daily`;
  165. TRUNCATE TABLE `report_viewed_product_aggregated_monthly`;
  166. TRUNCATE TABLE `report_viewed_product_aggregated_yearly`;
  167. TRUNCATE TABLE `report_viewed_product_index`;
  168.  
  169. SET FOREIGN_KEY_CHECKS = 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement