From d26a5d82bb513d7e609dbca9278b8ceae16c5cc9 Mon Sep 17 00:00:00 2001 From: yedongfu Date: Tue, 29 Jun 2021 14:26:31 +0800 Subject: [PATCH] add trading state --- examples/examples.sql | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/examples.sql b/examples/examples.sql index 5b23042..1db3e05 100644 --- a/examples/examples.sql +++ b/examples/examples.sql @@ -11,4 +11,17 @@ create table if not exists user_account( key(update_time) ); -insert into user_account (user_id, balance) values (1, 10000), (2, 10000) on DUPLICATE KEY UPDATE balance=values (balance); \ No newline at end of file +insert into user_account (user_id, balance) values (1, 10000), (2, 10000) on DUPLICATE KEY UPDATE balance=values (balance); + +drop table if exists user_account_trading; +create table if not exists user_account_trading( -- 表示交易中被冻结的金额 + id int(11) PRIMARY KEY AUTO_INCREMENT, + user_id int(11) UNIQUE , + frozen DECIMAL(10, 2) not null default '0', + create_time datetime DEFAULT now(), + update_time datetime DEFAULT now(), + key(create_time), + key(update_time) +); + +insert into user_account_trading (user_id, balance) values (1, 0), (2, 0) on DUPLICATE KEY UPDATE balance=values (balance); \ No newline at end of file