小享业务演示机 - 清数据脚本

kevin.Zhu 发布于:2022-3-16 15:08 分类:运营  有 18 人浏览,获得评论 0 条  

基于线的系统 CP下来的数据库 , 需要做以下数据清理工作   : 

 

mysql 环境  : 

SET FOREIGN_KEY_CHECKS = 0;

delete from customers where id != 'z75' ; 
delete from ui_themes where id  not in(2649,2637,2636,2635,2634,2633,2632) ; 

# oem_hotel
delete from terminals ; 
delete from authorization_machines ;
delete from illegal_warning_termainals ; 

TRUNCATE TABLE `tvdata_client_type_totals`;
TRUNCATE TABLE `tvdata_size_totals`;

TRUNCATE TABLE `tvdata_city_totals`;
TRUNCATE TABLE `tvdata_client_type_days`;
TRUNCATE TABLE `tvdata_client_type_months`;
TRUNCATE TABLE `tvdata_client_type_quarters`;
TRUNCATE TABLE `tvdata_client_type_weeks`;
TRUNCATE TABLE `tvdata_client_type_years`;
TRUNCATE TABLE `tvdata_customer_days`;
TRUNCATE TABLE `tvdata_customer_months`;
TRUNCATE TABLE `tvdata_customer_quarters`;
TRUNCATE TABLE `tvdata_customer_totals`;
TRUNCATE TABLE `tvdata_customer_weeks`;
TRUNCATE TABLE `tvdata_customer_years`;
TRUNCATE TABLE `tvdata_customer_province_totals`;
TRUNCATE TABLE `tvdata_customer_city_totals`;
TRUNCATE TABLE `tvdata_launcher_days`;
TRUNCATE TABLE `tvdata_launcher_totals`;
TRUNCATE TABLE `tvdata_province_totals`;
TRUNCATE TABLE `tvdata_size_days`;
TRUNCATE TABLE `tvdata_terminal_days`;
TRUNCATE TABLE `tvdata_terminal_months`;
TRUNCATE TABLE `tvdata_terminal_quarters`;
TRUNCATE TABLE `tvdata_terminal_totals`;
TRUNCATE TABLE `tvdata_terminal_weeks`;
TRUNCATE TABLE `tvdata_terminal_years`;


TRUNCATE TABLE `tvdata_customer_client_type_days`;
TRUNCATE TABLE `tvdata_customer_client_type_totals`;
TRUNCATE TABLE `tvdata_customer_launcher_days`;
TRUNCATE TABLE `tvdata_customer_launcher_totals`;
TRUNCATE TABLE `tvdata_customer_size_days`;
TRUNCATE TABLE `tvdata_customer_size_totals`;
TRUNCATE TABLE `tvdata_customer_city_days`;
TRUNCATE TABLE `tvdata_customer_province_days`;
TRUNCATE TABLE `tvdata_brand_days`;
TRUNCATE TABLE `tvdata_brand_totals`;
TRUNCATE TABLE `tvdata_brand_client_type_days`;
TRUNCATE TABLE `tvdata_brand_client_type_totals`;
TRUNCATE TABLE `tvdata_brand_size_days`;
TRUNCATE TABLE `tvdata_brand_size_totals`;
TRUNCATE TABLE `tvdata_brand_city_totals`;
TRUNCATE TABLE `tvdata_brand_province_totals`;
TRUNCATE TABLE `tvdata_brand_city_days`;
TRUNCATE TABLE `tvdata_brand_province_days`;

-- TRUNCATE TABLE `tvdata_online_hours`;

SET FOREIGN_KEY_CHECKS = 1;


PHP 环境:  

/opt/runtime/php/bin/php artisan  day:info-terminal

/opt/runtime/php/bin/php artisan  day:tvolddata-terminal-new