crypto_quant/sql/table/crypto_market_data.sql

15 lines
568 B
MySQL
Raw Normal View History

CREATE TABLE IF NOT EXISTS crypto_market_data (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
symbol VARCHAR(50) NOT NULL,
bar VARCHAR(20) NOT NULL,
timestamp BIGINT NOT NULL,
date_time VARCHAR(50) NOT NULL,
open DECIMAL(20,5) NOT NULL,
high DECIMAL(20,5) NOT NULL,
low DECIMAL(20,5) NOT NULL,
close DECIMAL(20,5) NOT NULL,
volume DECIMAL(30,8) NOT NULL,
volCcy DECIMAL(30,8) NOT NULL,
volCCyQuote DECIMAL(30,8) NOT NULL,
UNIQUE KEY uniq_symbol_bar_timestamp (symbol, bar, timestamp)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;