refactor(account): 移除卡类型字段、优化账号列表查询和权限检查
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m18s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m18s
- 移除 IoT 卡和号卡的 card_type 字段(数据库迁移) - 优化账号列表查询,支持按店铺和企业筛选 - 账号响应增加店铺名称和企业名称字段 - 实现批量加载店铺和企业名称,避免 N+1 查询 - 更新权限检查中间件,完善权限验证逻辑 - 更新相关测试用例,确保功能正确性
This commit is contained in:
10
migrations/000041_remove_card_type_field.down.sql
Normal file
10
migrations/000041_remove_card_type_field.down.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- 回滚:恢复 card_type 字段
|
||||
-- 注意:回滚后字段值为空,需要手动填充数据
|
||||
|
||||
-- 恢复 IoT 卡表的 card_type 列
|
||||
ALTER TABLE tb_iot_card ADD COLUMN card_type VARCHAR(50);
|
||||
COMMENT ON COLUMN tb_iot_card.card_type IS '卡类型(已废弃,仅用于回滚)';
|
||||
|
||||
-- 恢复号卡表的 card_type 列
|
||||
ALTER TABLE tb_number_card ADD COLUMN card_type VARCHAR(50);
|
||||
COMMENT ON COLUMN tb_number_card.card_type IS '号卡类型(已废弃,仅用于回滚)';
|
||||
9
migrations/000041_remove_card_type_field.up.sql
Normal file
9
migrations/000041_remove_card_type_field.up.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
-- 删除 IoT 卡和号卡表中无用的 card_type 字段
|
||||
-- 原因:该字段设计为存储技术规格("4G"、"5G"、"NB-IoT"),但实际业务中完全未使用
|
||||
-- 影响:无业务逻辑依赖该字段,删除不影响现有功能
|
||||
|
||||
-- 删除 IoT 卡表的 card_type 列
|
||||
ALTER TABLE tb_iot_card DROP COLUMN IF EXISTS card_type;
|
||||
|
||||
-- 删除号卡表的 card_type 列
|
||||
ALTER TABLE tb_number_card DROP COLUMN IF EXISTS card_type;
|
||||
Reference in New Issue
Block a user