当前位置:操作系统 > Unix/Linux >>

magento删除所有用户订单delete order customer

magento删除所有用户订单delete order customer
 
01
SET FOREIGN_KEY_CHECKS=0;
02
  
03
-- Here's where we reset the orders
04
TRUNCATE `sales_flat_order`;
05
TRUNCATE `sales_flat_order_address`;
06
TRUNCATE `sales_flat_order_grid`;
07
TRUNCATE `sales_flat_order_item`;
08
TRUNCATE `sales_flat_order_status_history`;
09
TRUNCATE `sales_flat_quote`;
10
TRUNCATE `sales_flat_quote_address`;
11
TRUNCATE `sales_flat_quote_address_item`;
12
TRUNCATE `sales_flat_quote_item`;
13
TRUNCATE `sales_flat_quote_item_option`;
14
TRUNCATE `sales_flat_order_payment`;
15
TRUNCATE `sales_flat_quote_payment`;
16
TRUNCATE `sales_flat_shipment`;
17
TRUNCATE `sales_flat_shipment_item`;
18
TRUNCATE `sales_flat_shipment_grid`;
19
TRUNCATE `sales_flat_invoice`;
20
TRUNCATE `sales_flat_invoice_grid`;
21
TRUNCATE `sales_flat_invoice_item`;
22
TRUNCATE `sendfriend_log`;
23
TRUNCATE `tag`;
24
TRUNCATE `tag_relation`;
25
TRUNCATE `tag_summary`;
26
TRUNCATE `wishlist`;
27
TRUNCATE `log_quote`;
28
TRUNCATE `report_event`;
29
  
30
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
31
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
32
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
33
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
34
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
35
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
36
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
37
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
38
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
39
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
40
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
41
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
42
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
43
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
44
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
45
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
46
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
47
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
48
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
49
ALTER TABLE `tag` AUTO_INCREMENT=1;
50
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
51
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
52
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
53
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
54
ALTER TABLE `report_event` AUTO_INCREMENT=1;
55
  
56
-- Here's where we reset the customers
57
TRUNCATE `customer_address_entity`;
58
TRUNCATE `customer_address_entity_datetime`;
59
TRUNCATE `customer_address_entity_decimal`;
60
TRUNCATE `customer_address_entity_int`;
61
TRUNCATE `customer_address_entity_text`;
62
TRUNCATE `customer_address_entity_varchar`;
63
TRUNCATE `customer_entity`;
64
TRUNCATE `customer_entity_datetime`;
65
TRUNCATE `customer_entity_decimal`;
66
TRUNCATE `customer_entity_int`;
67
TRUNCATE `customer_entity_text`;
68
TRUNCATE `customer_entity_varchar`;
69
TRUNCATE `log_customer`;
70
TRUNCATE `log_visitor`;
71
TRUNCATE `log_visitor_info`;
72
  
73
ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
74
ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
75
ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
76
ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
77
ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
78
ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
79
ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
80
ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
81
ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
82
ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
83
ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
84
ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
85
ALTER TABLE `log_customer` AUTO_INCREMENT=1;
86
ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
87
ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;
88
  
89
-- This is to Reset all the ID counters
90
TRUNCATE `eav_entity_store`;
91
ALTER TABLE `eav_entity_store` AUTO_INCREMENT=1;
92
  
93
SET FOREIGN_KEY_CHECKS=1;

 


CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,