func ParseSchema(schema string) *MySchema {
	schema = strings.TrimSpace(schema)
	lines := strings.Split(schema, "\n")
	mys := &MySchema{
		SchemaRaw:  schema,
		Fields:     orderedmap.NewOrderedMap(),
		IndexAll:   make(map[string]*DbIndex),
		ForeignAll: make(map[string]*DbIndex),
	}
	for i := 1; i < len(lines)-1; i++ {
		line := strings.TrimSpace(lines[i])
		if line == "" {
			continue
		}
		line = strings.TrimRight(line, ",")
		if line[0] == '`' {
			index := strings.Index(line[1:], "`")
			name := line[1 : index+1]
			mys.Fields.Set(name, line)
		} else {
			idx := parseDbIndexLine(line)
			if idx == nil {
				continue
			}
			switch idx.IndexType {
			case indexTypeForeignKey:
				mys.ForeignAll[idx.Name] = idx
			default:
				mys.IndexAll[idx.Name] = idx
			}
		}
	}
	return mys
}
ParseSchema parse table's schema
package internal
import (
	"bytes"
	"fmt"
	"strings"
	"github.com/elliotchance/orderedmap"
)
type MySchema struct {
	SchemaRaw  string
	Fields     *orderedmap.OrderedMap
	IndexAll   map[string]*DbIndex
	ForeignAll map[string]*DbIndex
}
func (mys *MySchema) String() string {
	var buf bytes.Buffer
	buf.WriteString("Fields:\n")
	fl := maxMapKeyLen(mys.Fields, 2)
	for name, v := range mys.Fields.Keys() {
		buf.WriteString(fmt.Sprintf("  %"+fl+"s : %s\n", name, v))
	}
	buf.WriteString("Index:\n")
	fl = maxMapKeyLen(mys.IndexAll, 2)
	for name, idx := range mys.IndexAll {
		buf.WriteString(fmt.Sprintf("  %"+fl+"s : %s\n", name, idx.SQL))
	}
	buf.WriteString("ForeignKey:\n")
	fl = maxMapKeyLen(mys.ForeignAll, 2)
	for name, idx := range mys.ForeignAll {
		buf.WriteString(fmt.Sprintf("  %"+fl+"s : %s\n", name, idx.SQL))
	}
	return buf.String()
}
func (mys *MySchema) GetFieldNames() []string {
	var names []string
	for _, name := range mys.Fields.Keys() {
		names = append(names, name.(string))
	}
	return names
}
func (mys *MySchema) RelationTables() []string {
	tbs := make(map[string]int)
	for _, idx := range mys.ForeignAll {
		for _, tb := range idx.RelationTables {
			tbs[tb] = 1
		}
	}
	var tables []string
	for tb := range tbs {
		tables = append(tables, tb)
	}
	return tables
}