-- IoT SIM 管理系统数据表删除脚本
-- 创建时间: 2026-01-12
-- 说明: 回滚所有 IoT SIM 管理相关表

-- 删除系统管理表
DROP TABLE IF EXISTS card_replacement_requests;
DROP TABLE IF EXISTS dev_capability_configs;

-- 删除财务管理表
DROP TABLE IF EXISTS payment_merchant_settings;
DROP TABLE IF EXISTS commission_withdrawal_settings;
DROP TABLE IF EXISTS commission_withdrawal_requests;

-- 删除分佣相关表
DROP TABLE IF EXISTS carrier_settlements;
DROP TABLE IF EXISTS commission_templates;
DROP TABLE IF EXISTS commission_approvals;
DROP TABLE IF EXISTS commission_records;
DROP TABLE IF EXISTS commission_combined_conditions;
DROP TABLE IF EXISTS commission_ladder;
DROP TABLE IF EXISTS commission_rules;
DROP TABLE IF EXISTS agent_hierarchies;

-- 删除套餐和轮询相关表
DROP TABLE IF EXISTS data_usage_records;
DROP TABLE IF EXISTS polling_configs;
DROP TABLE IF EXISTS package_usages;

-- 删除核心业务表
DROP TABLE IF EXISTS orders;
DROP TABLE IF EXISTS device_sim_bindings;
DROP TABLE IF EXISTS agent_package_allocations;
DROP TABLE IF EXISTS packages;
DROP TABLE IF EXISTS package_series;
DROP TABLE IF EXISTS number_cards;
DROP TABLE IF EXISTS devices;
DROP TABLE IF EXISTS iot_cards;
DROP TABLE IF EXISTS carriers;
