Files
code-bang/backend/clear_test_data.sql
T

40 lines
1.0 KiB
SQL
Raw Normal View History

2026-10-28 15:11:34 +08:00
-- 清空测试数据表
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- 会员与账户
TRUNCATE TABLE `fa_user`;
TRUNCATE TABLE `fa_user_token`;
TRUNCATE TABLE `fa_accounts`;
TRUNCATE TABLE `fa_account_logs`;
TRUNCATE TABLE `fa_account_withdraws`;
TRUNCATE TABLE `fa_user_money_log`;
TRUNCATE TABLE `fa_user_score_log`;
TRUNCATE TABLE `fa_developers`;
TRUNCATE TABLE `fa_transfer_authorizations`;
-- 需求(招标、投标、签约、沟通群)
TRUNCATE TABLE `fa_demands`;
TRUNCATE TABLE `fa_demand_biddings`;
TRUNCATE TABLE `fa_demand_contracts`;
-- 商城订单
TRUNCATE TABLE `fa_orders`;
TRUNCATE TABLE `fa_order_goods`;
TRUNCATE TABLE `fa_order_payment`;
TRUNCATE TABLE `fa_order_ships`;
TRUNCATE TABLE `fa_order_logistics`;
TRUNCATE TABLE `fa_order_refunds`;
-- 消息与验证码
TRUNCATE TABLE `fa_messages`;
TRUNCATE TABLE `fa_subscribe_messages`;
TRUNCATE TABLE `fa_sms`;
TRUNCATE TABLE `fa_ems`;
-- 日志、在线命令执行记录、队列、脚手架测试表、空的优惠券
TRUNCATE TABLE `fa_data_logs`;
SET FOREIGN_KEY_CHECKS = 1;