找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1254|回复: 0

[Magento] Magento清除测试注册的账号和订单方法

[复制链接]
发表于 2014-6-13 11:35:02 | 显示全部楼层 |阅读模式
Magento麦金斗网站开发过程中,我们通常会自己注册一个些账号,并下单购买测试网站是否能正常收款,在一切都测试忘了确定没问题后,在给客户交付网站前我们要将测试注册的账号和订单付款信息都删掉,那么该怎样操作?

进入phpmyadmin,然后运行下面SQL命令即可全部搞定:

  1. SET FOREIGN_KEY_CHECKS=0;

  2. -- Here's where we reset the orders
  3. TRUNCATE `sales_flat_order`;
  4. TRUNCATE `sales_flat_order_address`;
  5. TRUNCATE `sales_flat_order_grid`;
  6. TRUNCATE `sales_flat_order_item`;
  7. TRUNCATE `sales_flat_order_status_history`;
  8. TRUNCATE `sales_flat_quote`;
  9. TRUNCATE `sales_flat_quote_address`;
  10. TRUNCATE `sales_flat_quote_address_item`;
  11. TRUNCATE `sales_flat_quote_item`;
  12. TRUNCATE `sales_flat_quote_item_option`;
  13. TRUNCATE `sales_flat_order_payment`;
  14. TRUNCATE `sales_flat_quote_payment`;
  15. TRUNCATE `sales_flat_shipment`;
  16. TRUNCATE `sales_flat_shipment_item`;
  17. TRUNCATE `sales_flat_shipment_grid`;
  18. TRUNCATE `sales_flat_invoice`;
  19. TRUNCATE `sales_flat_invoice_grid`;
  20. TRUNCATE `sales_flat_invoice_item`;
  21. TRUNCATE `sendfriend_log`;
  22. TRUNCATE `tag`;
  23. TRUNCATE `tag_relation`;
  24. TRUNCATE `tag_summary`;
  25. TRUNCATE `wishlist`;
  26. TRUNCATE `log_quote`;
  27. TRUNCATE `report_event`;

  28. ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
  29. ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
  30. ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
  31. ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
  32. ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
  33. ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
  34. ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
  35. ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
  36. ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
  37. ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
  38. ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
  39. ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
  40. ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
  41. ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
  42. ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
  43. ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
  44. ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
  45. ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
  46. ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
  47. ALTER TABLE `tag` AUTO_INCREMENT=1;
  48. ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
  49. ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
  50. ALTER TABLE `wishlist` AUTO_INCREMENT=1;
  51. ALTER TABLE `log_quote` AUTO_INCREMENT=1;
  52. ALTER TABLE `report_event` AUTO_INCREMENT=1;

  53. -- Here's where we reset the customers
  54. TRUNCATE `customer_address_entity`;
  55. TRUNCATE `customer_address_entity_datetime`;
  56. TRUNCATE `customer_address_entity_decimal`;
  57. TRUNCATE `customer_address_entity_int`;
  58. TRUNCATE `customer_address_entity_text`;
  59. TRUNCATE `customer_address_entity_varchar`;
  60. TRUNCATE `customer_entity`;
  61. TRUNCATE `customer_entity_datetime`;
  62. TRUNCATE `customer_entity_decimal`;
  63. TRUNCATE `customer_entity_int`;
  64. TRUNCATE `customer_entity_text`;
  65. TRUNCATE `customer_entity_varchar`;
  66. TRUNCATE `log_customer`;
  67. TRUNCATE `log_visitor`;
  68. TRUNCATE `log_visitor_info`;

  69. ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
  70. ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
  71. ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
  72. ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
  73. ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
  74. ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
  75. ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
  76. ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
  77. ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
  78. ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
  79. ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
  80. ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
  81. ALTER TABLE `log_customer` AUTO_INCREMENT=1;
  82. ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
  83. ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;

  84. -- This is to Reset all the ID counters
  85. TRUNCATE `eav_entity_store`;
  86. ALTER TABLE `eav_entity_store` AUTO_INCREMENT=1;

  87. SET FOREIGN_KEY_CHECKS=1;
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|王牌互联

GMT+8, 2024-12-21 04:23 , Processed in 0.035481 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表