4

我正在搜索要在 MySql 上运行的脚本,以删除(截断表)PrestaShop 数据库版本 1.4.9 上的所有测试数据(客户、订单、购物车等)。感谢 Pascal

4

3 回答 3

12

安装 Prestashop Cleaner 并在配置中您可以选择删除目录、订单和客户

于 2014-01-09T13:53:33.593 回答
2

对于 1.5.6.2(可能适用于 1.5.6*,甚至可能适用于 1.5.*):

TRUNCATE `ps_access`;
TRUNCATE `ps_address`;
TRUNCATE `ps_alias`;
TRUNCATE `ps_attribute`;
TRUNCATE `ps_attribute_group`;
TRUNCATE `ps_attribute_group_lang`;
TRUNCATE `ps_attribute_group_shop`;
TRUNCATE `ps_attribute_lang`;
TRUNCATE `ps_attribute_shop`;
TRUNCATE `ps_carrier`;
TRUNCATE `ps_carrier_group`;
TRUNCATE `ps_carrier_lang`;
TRUNCATE `ps_carrier_shop`;
TRUNCATE `ps_carrier_tax_rules_group_shop`;
TRUNCATE `ps_carrier_zone`;
TRUNCATE `ps_cart`;
TRUNCATE `ps_cart_product`;
TRUNCATE `ps_category`;
TRUNCATE `ps_category_group`;
TRUNCATE `ps_category_lang`;
TRUNCATE `ps_category_product`;
TRUNCATE `ps_category_shop`;
TRUNCATE `ps_cms`;
TRUNCATE `ps_cms_block`;
TRUNCATE `ps_cms_block_lang`;
TRUNCATE `ps_cms_block_page`;
TRUNCATE `ps_cms_block_shop`;
TRUNCATE `ps_cms_category`;
TRUNCATE `ps_cms_category_lang`;
TRUNCATE `ps_cms_lang`;
TRUNCATE `ps_cms_shop`;
TRUNCATE `ps_connections`;
TRUNCATE `ps_contact_lang`;
TRUNCATE `ps_contact_shop`;
TRUNCATE `ps_customer`;
TRUNCATE `ps_customer_group`;
TRUNCATE `ps_delivery`;
TRUNCATE `ps_feature`;
TRUNCATE `ps_feature_lang`;
TRUNCATE `ps_feature_shop`;
TRUNCATE `ps_feature_value`;
TRUNCATE `ps_feature_value_lang`;
TRUNCATE `ps_guest`;
TRUNCATE `ps_homeslider`;
TRUNCATE `ps_homeslider_slides`;
TRUNCATE `ps_homeslider_slides_lang`;
TRUNCATE `ps_image`;
TRUNCATE `ps_image_lang`;
TRUNCATE `ps_image_shop`;
TRUNCATE `ps_image_type`;
TRUNCATE `ps_manufacturer`;
TRUNCATE `ps_manufacturer_lang`;
TRUNCATE `ps_manufacturer_shop`;
TRUNCATE `ps_orders`;
TRUNCATE `ps_order_carrier`;
TRUNCATE `ps_order_cart_rule`;
TRUNCATE `ps_order_detail`;
TRUNCATE `ps_order_detail_tax`;
TRUNCATE `ps_order_history`;
TRUNCATE `ps_order_invoice`;
TRUNCATE `ps_order_invoice_payment`;
TRUNCATE `ps_order_invoice_tax`;
TRUNCATE `ps_order_message`;
TRUNCATE `ps_order_message_lang`;
TRUNCATE `ps_order_return_state`;
TRUNCATE `ps_order_return_state_lang`;
TRUNCATE `ps_order_state`;
TRUNCATE `ps_order_state_lang`;
TRUNCATE `ps_page`;
TRUNCATE `ps_page_type`;
TRUNCATE `ps_product`;
TRUNCATE `ps_product_attribute`;
TRUNCATE `ps_product_attribute_combination`;
TRUNCATE `ps_product_attribute_image`;
TRUNCATE `ps_product_attribute_shop`;
TRUNCATE `ps_product_lang`;
TRUNCATE `ps_product_shop`;
TRUNCATE `ps_product_supplier`;
TRUNCATE `ps_product_tag`;
TRUNCATE `ps_range_price`;
TRUNCATE `ps_range_weight`;
TRUNCATE `ps_reinsurance`;
TRUNCATE `ps_reinsurance_lang`;
TRUNCATE `ps_scene`;
TRUNCATE `ps_scene_category`;
TRUNCATE `ps_scene_lang`;
TRUNCATE `ps_scene_products`;
TRUNCATE `ps_scene_shop`;
TRUNCATE `ps_search_index`;
TRUNCATE `ps_search_word`;
TRUNCATE `ps_specific_price`;
TRUNCATE `ps_stock_available`;
TRUNCATE `ps_stock_mvt_reason`;
TRUNCATE `ps_stock_mvt_reason_lang`;
TRUNCATE `ps_store`;
TRUNCATE `ps_store_shop`;
TRUNCATE `ps_supplier`;
TRUNCATE `ps_supplier_lang`;
TRUNCATE `ps_supplier_shop`;
TRUNCATE `ps_supply_order_state`;
TRUNCATE `ps_supply_order_state_lang`;
TRUNCATE `ps_tag`;

在你开始之前会给你一个干净、准备好的数据库。

于 2014-03-25T10:37:45.790 回答
1

请注意,此站点不适用于为您的任何类型的工作寻找脚本。这只是提供建议,并基于该建议提供逐步指导和示例脚本/代码。如何从 PS 安装中删除测试数据很简单。

1) 转到管理面板。2)删除类别和产品 3)删除客户 4)删除购物车和订单。

这是最简单的方法。但是,如果您想为它们截断表格,请按照以下步骤操作

1) 在您的服务器上访问 PhpMyAdmin。2) 找到您的 PS 安装使用的数据库 3) 对于客户,截断 ps_customers、ps_address 4) 对于购物车,截断 ps_cart、ps_cart_products 5) 对于订单,截断 ps_order、ps_order_details、

请注意,上述截断只会从管理员和数据库中删除这些数据,但还有一些其他表也可以被截断。但必须的,因为如果你不这样做,那么数据将不会显示在管理员中,所以根本不需要。我不能列出它们,因为有了新的 PS 版本,表格会改变。

于 2013-03-09T06:15:10.213 回答