# 清空商品分类、商品、属性
TRUNCATE TABLE categories;
TRUNCATE TABLE categories_description;
# 清空商品以及属性
TRUNCATE TABLE media_clips;
TRUNCATE TABLE media_manager;
TRUNCATE TABLE media_to_products;
TRUNCATE TABLE media_types;
TRUNCATE TABLE music_genre;
TRUNCATE TABLE product_music_extra;
TRUNCATE TABLE product_types_to_category;
TRUNCATE TABLE products;
TRUNCATE TABLE products_attributes;
TRUNCATE TABLE products_attributes_download;
TRUNCATE TABLE products_description;
TRUNCATE TABLE products_discount_quantity;
TRUNCATE TABLE products_notifications;
TRUNCATE TABLE products_options;
TRUNCATE TABLE products_options_types;
TRUNCATE TABLE products_options_values;
TRUNCATE TABLE products_options_values_to_products_options;
TRUNCATE TABLE products_to_categories;
TRUNCATE TABLE record_artists;
TRUNCATE TABLE record_artists_info;
TRUNCATE TABLE record_company;
TRUNCATE TABLE record_company_info;
# 清空推荐商品
TRUNCATE TABLE featured;
# 清空促销商品
TRUNCATE TABLE salemaker_sales;
# 清空特价商品
TRUNCATE TABLE specials;
# 清空团体价格
TRUNCATE TABLE group_pricing;
# 清空厂家及资料
TRUNCATE TABLE manufacturers;
TRUNCATE TABLE manufacturers_info;
# 清空客户评论
TRUNCATE TABLE reviews;
TRUNCATE TABLE reviews_description;
#清空前台注册用户 订单 历史订单等信息 慎用
TRUNCATE TABLE `address_book`;
TRUNCATE TABLE `admin_activity_log`;
TRUNCATE TABLE `counter`;
TRUNCATE TABLE `counter_history`;
TRUNCATE TABLE `customers`;
TRUNCATE TABLE `customers_basket`;
TRUNCATE TABLE `customers_info`;
TRUNCATE TABLE `orders`;
TRUNCATE TABLE `orders_products`;
TRUNCATE TABLE `orders_status_history`;
TRUNCATE TABLE `orders_total`;
TRUNCATE TABLE `paypal`;
TRUNCATE TABLE `paypal_payment_status_history`;
TRUNCATE TABLE `paypal_session`;
update `products_description` set `products_viewed` = '0' WHERE `products_viewed` > '0';
update `products` set `products_ordered` = '0' WHERE `products_ordered` > '0';
TRUNCATE TABLE categories;
TRUNCATE TABLE categories_description;
# 清空商品以及属性
TRUNCATE TABLE media_clips;
TRUNCATE TABLE media_manager;
TRUNCATE TABLE media_to_products;
TRUNCATE TABLE media_types;
TRUNCATE TABLE music_genre;
TRUNCATE TABLE product_music_extra;
TRUNCATE TABLE product_types_to_category;
TRUNCATE TABLE products;
TRUNCATE TABLE products_attributes;
TRUNCATE TABLE products_attributes_download;
TRUNCATE TABLE products_description;
TRUNCATE TABLE products_discount_quantity;
TRUNCATE TABLE products_notifications;
TRUNCATE TABLE products_options;
TRUNCATE TABLE products_options_types;
TRUNCATE TABLE products_options_values;
TRUNCATE TABLE products_options_values_to_products_options;
TRUNCATE TABLE products_to_categories;
TRUNCATE TABLE record_artists;
TRUNCATE TABLE record_artists_info;
TRUNCATE TABLE record_company;
TRUNCATE TABLE record_company_info;
# 清空推荐商品
TRUNCATE TABLE featured;
# 清空促销商品
TRUNCATE TABLE salemaker_sales;
# 清空特价商品
TRUNCATE TABLE specials;
# 清空团体价格
TRUNCATE TABLE group_pricing;
# 清空厂家及资料
TRUNCATE TABLE manufacturers;
TRUNCATE TABLE manufacturers_info;
# 清空客户评论
TRUNCATE TABLE reviews;
TRUNCATE TABLE reviews_description;
#清空前台注册用户 订单 历史订单等信息 慎用
TRUNCATE TABLE `address_book`;
TRUNCATE TABLE `admin_activity_log`;
TRUNCATE TABLE `counter`;
TRUNCATE TABLE `counter_history`;
TRUNCATE TABLE `customers`;
TRUNCATE TABLE `customers_basket`;
TRUNCATE TABLE `customers_info`;
TRUNCATE TABLE `orders`;
TRUNCATE TABLE `orders_products`;
TRUNCATE TABLE `orders_status_history`;
TRUNCATE TABLE `orders_total`;
TRUNCATE TABLE `paypal`;
TRUNCATE TABLE `paypal_payment_status_history`;
TRUNCATE TABLE `paypal_session`;
update `products_description` set `products_viewed` = '0' WHERE `products_viewed` > '0';
update `products` set `products_ordered` = '0' WHERE `products_ordered` > '0';
二 批量增加各常用项数据字段
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
三批量变更商品部分属性
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
最后再补充一个 修复 因使用批量删除导致的后台添加商品属性下拉选择空白的SQL
详情可以参见:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|