hyapp-server/scripts/mysql/068_wallet_withdrawal_terminal_locks.sql
2026-07-16 18:51:58 +08:00

12 lines
806 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.

USE hyapp_wallet;
-- 该表只按用户提现申请增长,创建空表不扫描 wallet_transactions不会在现有 10GB 级流水表上建索引或持有行锁。
-- 必须在部署包含新终局幂等逻辑的 wallet-service 之前执行CREATE TABLE IF NOT EXISTS 可安全重复执行。
CREATE TABLE IF NOT EXISTS wallet_withdrawal_terminal_locks (
app_code VARCHAR(32) NOT NULL COMMENT '应用编码',
withdrawal_application_id VARCHAR(64) NOT NULL COMMENT '后台提现申请 ID',
created_at_ms BIGINT NOT NULL COMMENT '创建时间UTC epoch ms',
updated_at_ms BIGINT NOT NULL COMMENT '更新时间UTC epoch ms',
PRIMARY KEY (app_code, withdrawal_application_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='提现申请钱包终局串行锁';