
CREATE TABLE tracer_log (
  tracerId Int64,
  className String,
  threadName String,
  methodName String,
  logLevel String,
  content String,
  node String,
  normal String,
  tag1 String,
 createTime DateTime
) ENGINE = MergeTree()
    PARTITION BY toYYYYMMDD ( createTime )
    ORDER BY createTime
    PRIMARY key createTime
    TTL createTime + toIntervalDay ( 15 );



  CREATE TABLE tracer_model (
    tracerId Int64,
    requestContent String,
    responseContent String,
    costTime String,
    uid String,
    errno String,
    errmsg String,
    app String,
    uri String,
   createTime DateTime
  ) ENGINE = MergeTree()
   PARTITION BY toYYYYMMDD ( createTime )
   ORDER BY ( uid, createTime )
    PRIMARY key uid
   TTL createTime + toIntervalDay ( 15 );


CREATE TABLE action_log  (
                                        log_id Int64 COMMENT '日志主键',
                                        app_id Int8 COMMENT '应用id',

                                        method String COMMENT '方法名称',
                                        business_name String COMMENT '操作模块',
                                        business_type  String COMMENT '业务类型',
                                        request_method String COMMENT '请求方式',
                                        operator_type Int8  COMMENT '操作人员（0用户 1系统自动）',
                                        oper_uid String COMMENT '操作人员id',
                                        oper_user_name String COMMENT '操作人员',
                                        dept_name String COMMENT '部门名称',
                                        oper_url String COMMENT '请求URL',
                                        oper_ip String COMMENT '主机地址',
                                        oper_location String COMMENT '操作地点',
                                        oper_param String COMMENT '请求参数',
                                        json_result String COMMENT '返回参数',
                                        status Int8  COMMENT '操作状态（0正常 1异常）',
                                        error_msg String COMMENT '错误消息',
                                        create_time DateTime COMMENT '操作时间',
                                        before_value String COMMENT '更新前数据',
                                        after_value String COMMENT '更新后数据',
                                        business_id String  COMMENT '业务主键',
                                        response_time Int8  COMMENT '响应时长'
)
                                        ENGINE = MergeTree()
                                            PARTITION BY toYYYYMMDD ( create_time )
                                            ORDER BY ( log_id, create_time )
                                            PRIMARY key log_id;

