"""
index_weight 表结构定义（Python，变量名 schema）

指数成分股权重。主键 id/date/stock_id nullable=false；其余 nullable=true。
"""
schema = {
    "storage_domain": "data",  # 市场/宏观/股票主数据等（data 域）
    "update_key": "index_stock_index_weight",
    "name": "sys_index_weight",
    "primaryKey": ["id", "date", "stock_id"],
    "fields": [
        {
            "name": "id",
            "type": "varchar",
            "length": 16,
            "isRequired": True,
            "nullable": False,
            "description": "指数代码",
        },
        {
            "name": "date",
            "type": "varchar",
            "length": 8,
            "isRequired": True,
            "nullable": False,
            "description": "日期 YYYYMMDD",
        },
        {
            "name": "stock_id",
            "type": "varchar",
            "length": 16,
            "isRequired": True,
            "nullable": False,
            "description": "指数成分股代码",
        },
        {
            "name": "weight",
            "type": "float",
            "isRequired": True,
            "nullable": True,
            "description": "指数成分股权重",
        },
    ],
}
