app-cloudep-trade-service/generate/database/mysql/20230913072305_create_walle...

19 lines
1.2 KiB
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.

CREATE TABLE `wallet_journal` (
`id` BIGINT(20) AUTO_INCREMENT NOT NULL COMMENT '錢包賬本流水號',
`transaction_id` BIGINT(20) NOT NULL COMMENT '交易 ID對應 transaction 表',
`order_id` VARCHAR(200) NOT NULL COMMENT '訂單 ID對應 order 表',
`brand` VARCHAR(50) NOT NULL COMMENT '品牌名稱',
`uid` VARCHAR(50) NOT NULL COMMENT '用戶 ID',
`wallet_type` TINYINT NOT NULL COMMENT '餘額種類: 1=可用, 2=凍結, 3=限制(僅出金)',
`currency` VARCHAR(20) NOT NULL COMMENT '幣種或平台點數',
`transaction_amount` DECIMAL(30, 18) UNSIGNED DEFAULT 0 NOT NULL COMMENT '交易金額',
`post_transaction_balance` DECIMAL(30, 18) UNSIGNED DEFAULT 0 NOT NULL COMMENT '交易後餘額',
`business_type` TINYINT NOT NULL COMMENT '業務類型',
`status` TINYINT NOT NULL DEFAULT 0 COMMENT '狀態',
`due_time` BIGINT NOT NULL DEFAULT 0 COMMENT 'T+N 執行時間',
`created_at` BIGINT NOT NULL COMMENT '創建時間Unix 時間戳,毫秒)',
PRIMARY KEY (`id`),
KEY `idx_user_brand` (`uid`, `brand`),
KEY `idx_order_id` (`order_id`),
KEY `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用戶錢包變動';