backtrader/sql/calendar.sql
2025-04-05 22:39:24 +08:00

12 lines
563 B
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 IF NOT EXISTS `calendar` (
trade_date DATE PRIMARY KEY COMMENT '交易日期',
exchange VARCHAR(10) COMMENT '交易所代码',
is_open TINYINT COMMENT '是否交易0休市 1交易',
pretrade_date DATE COMMENT '上一个交易日',
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
INDEX idx_exchange (exchange),
INDEX idx_is_open (is_open)
) ENGINE=InnoDB COMMENT '交易日历表';