修复钱包充值bug
This commit is contained in:
parent
155b159c83
commit
802136d47f
@ -229,7 +229,7 @@ wallet_recharge_records(
|
||||
target_region_id BIGINT NOT NULL,
|
||||
policy_id BIGINT NOT NULL,
|
||||
policy_version VARCHAR(64) NOT NULL,
|
||||
currency_code VARCHAR(3) NOT NULL,
|
||||
currency_code VARCHAR(8) NOT NULL,
|
||||
coin_amount BIGINT NOT NULL,
|
||||
usd_minor_amount BIGINT NOT NULL,
|
||||
exchange_coin_amount BIGINT NOT NULL,
|
||||
|
||||
27
scripts/mysql/035_wallet_recharge_record_currency_code.sql
Normal file
27
scripts/mysql/035_wallet_recharge_record_currency_code.sql
Normal file
@ -0,0 +1,27 @@
|
||||
-- Expand wallet recharge record currency codes so Google Play products such as USDT
|
||||
-- can be snapshotted before payment order auditing and Google consume.
|
||||
|
||||
SET @wallet_recharge_record_currency_ddl := (
|
||||
SELECT CASE
|
||||
WHEN COUNT(*) = 0 THEN 'SELECT 1'
|
||||
WHEN MAX(CHARACTER_MAXIMUM_LENGTH) < 8 THEN
|
||||
'ALTER TABLE wallet_recharge_records MODIFY COLUMN currency_code VARCHAR(8) NOT NULL COMMENT ''币种编码'''
|
||||
ELSE 'SELECT 1'
|
||||
END
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'wallet_recharge_records'
|
||||
AND COLUMN_NAME = 'currency_code'
|
||||
);
|
||||
|
||||
PREPARE stmt FROM @wallet_recharge_record_currency_ddl;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
SELECT
|
||||
COLUMN_TYPE AS wallet_recharge_records_currency_code_type,
|
||||
IS_NULLABLE AS wallet_recharge_records_currency_code_nullable
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'wallet_recharge_records'
|
||||
AND COLUMN_NAME = 'currency_code';
|
||||
@ -439,7 +439,7 @@ CREATE TABLE IF NOT EXISTS wallet_recharge_records (
|
||||
target_region_id BIGINT NOT NULL COMMENT '目标区域 ID',
|
||||
policy_id BIGINT NOT NULL COMMENT '策略 ID',
|
||||
policy_version VARCHAR(64) NOT NULL COMMENT '策略版本',
|
||||
currency_code VARCHAR(3) NOT NULL COMMENT '币种编码',
|
||||
currency_code VARCHAR(8) NOT NULL COMMENT '币种编码',
|
||||
coin_amount BIGINT NOT NULL COMMENT '金币数量',
|
||||
usd_minor_amount BIGINT NOT NULL COMMENT '美元最小单位数量',
|
||||
exchange_coin_amount BIGINT NOT NULL COMMENT '兑换金币数量',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user