Files
junhong_cmp_fiber/migrations/000098_backfill_asset_wallets.down.sql
huang f339fb1987
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m8s
fix: 资产钱包自动创建机制 — 修复C端购买时钱包不存在报错
- client_order: 新增 getOrCreateWallet 兜底,钱包不存在时自动创建
- device_import: 设备导入事务内同步创建设备钱包
- iot_card_import: IoT卡批量导入后批量创建卡钱包
- queue/handler: 传递 AssetWalletStore 给两个导入 handler
- migration 000098: 为存量IoT卡和设备补建资产钱包
2026-03-30 11:37:41 +08:00

9 lines
302 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 回滚删除补建的空钱包仅删除余额为0且无交易记录的钱包
DELETE FROM tb_asset_wallet
WHERE balance = 0
AND frozen_balance = 0
AND deleted_at IS NULL
AND id NOT IN (
SELECT DISTINCT asset_wallet_id FROM tb_asset_wallet_transaction WHERE deleted_at IS NULL
);