func (h *HistoryInfo) AddDBInfo(schemaVer int64, dbInfo *DatabaseMeta) {
	h.SchemaVersion = schemaVer
	h.DBInfo = dbInfo
}
AddDBInfo adds schema version and schema information that are used for binlog.
dbInfo is added in the following operations: create database, drop database.
package model
import (
	"encoding/json"
	"fmt"
	"math"
	"sync"
	"time"
	"github.com/pingcap/errors"
	"github.com/pingcap/parser/terror"
)
type ActionType byte
const (
	ActionNone ActionType = iota
	ActionCreateSchema
	ActionDropSchema
	ActionCreateTable
	ActionDropTable
	ActionAddColumn
	ActionDropColumn
	ActionAddIndex
	ActionDropIndex
	ActionTruncateTable
	ActionModifyColumn
	ActionRenameTable
	ActionSetDefaultValue
	ActionAddTablePartition
	ActionDropTablePartition
	ActionAddPrimaryKey
	ActionDropPrimaryKey
	ActionAddForeignKey
	ActionDropForeignKey
	ActionModifySchemaCharsetAndCollate
)
const (
	AddIndexStr      = "add index"
	AddPrimaryKeyStr = "add primary key"
)
var actionMap = map[ActionType]string{
	ActionCreateSchema:       "create schema",
	ActionDropSchema:         "drop schema",
	ActionCreateTable:        "create table",
	ActionDropTable:          "drop table",
	ActionAddColumn:          "add column",
	ActionDropColumn:         "drop column",
	ActionAddIndex:           AddIndexStr,
	ActionDropIndex:          "drop index",
	ActionTruncateTable:      "truncate table",
	ActionModifyColumn:       "modify column",
	ActionRenameTable:        "rename table",
	ActionSetDefaultValue:    "set default value",
	ActionAddTablePartition:  "add partition",
	ActionDropTablePartition: "drop partition",
	ActionAddPrimaryKey:      AddPrimaryKeyStr,
	ActionDropPrimaryKey:     "drop primary key",
}
func (action ActionType) String() string {
	if v, ok := actionMap[action]; ok {
		return v
	}
	return "none"
}
type HistoryInfo struct {
	SchemaVersion int64
	DBInfo        *DatabaseMeta
	TableInfo     *TableMeta
	FinishedTS    uint64
}