1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| for i in test_ETH_BTC test_BTC_USDT test_ETH_USDT test_BCH_BTC test_BCH_ETH test_BCH_USDT test_ETC_BTC test_ETC_ETH test_ETC_USDT test_LTC_BTC test_LTC_ETH test_LTC_USDT test_OMG_BTC test_OMG_ETH test_OMG_USDT test_ACT_BTC test_ACT_ETH test_ACT_USDT ; do for j in {0..19} do sql="CREATE TABLE \`match_record_${j}\` ( \`id\` bigint(20) NOT NULL AUTO_INCREMENT , \`symbol\` varchar(30) NOT NULL COMMENT '交易对', \`price\` decimal(30,15) NOT NULL COMMENT '成交价格', \`quantity\` decimal(30,15) NOT NULL COMMENT '成交量', \`buy_match_seq\` int(11) NOT NULL COMMENT '买入成交序号', \`buy_tx_no\` varchar(32) NOT NULL COMMENT '买入交易单号', \`sell_match_seq\` int(11) NOT NULL COMMENT '卖出成交序号', \`sell_tx_no\` varchar(32) NOT NULL COMMENT '卖出交易单号', \`is_maker\` tinyint(1) NOT NULL COMMENT '买入方是否为maker', \`create_time\` bigint(20) NOT NULL COMMENT '成交时间戳', PRIMARY KEY (\`id\`), UNIQUE KEY \`uniq_idsymbol\` (\`id\`,\`symbol\`), UNIQUE KEY \`uniq_txno\` (\`buy_tx_no\`,\`sell_tx_no\`), KEY \`idx_create_time\` (\`create_time\`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='成交记录表'; " mysql -uroot -ptest -D $i -e"${sql}"; done done
|