From a2becccaa8223603bf5977daa836debc0f5a2a87 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 17 Feb 2015 15:02:28 +0800 Subject: [PATCH] bug fixed for sync --- mysql_dialect.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql_dialect.go b/mysql_dialect.go index 4d32186b..1a6019c6 100644 --- a/mysql_dialect.go +++ b/mysql_dialect.go @@ -317,7 +317,6 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column if err != nil { return nil, nil, err } - //fmt.Println(columnName, isNullable, colType, colKey, extra, colDefault) col.Name = strings.Trim(columnName, "` ") if "YES" == isNullable { col.Nullable = true @@ -467,15 +466,17 @@ func (db *mysql) GetIndexes(tableName string) (map[string]*core.Index, error) { } colName = strings.Trim(colName, "` ") - + var isRegular bool if strings.HasPrefix(indexName, "IDX_"+tableName) || strings.HasPrefix(indexName, "UQE_"+tableName) { indexName = indexName[5+len(tableName) : len(indexName)] + isRegular = true } var index *core.Index var ok bool if index, ok = indexes[indexName]; !ok { index = new(core.Index) + index.IsRegular = isRegular index.Type = indexType index.Name = indexName indexes[indexName] = index