bug fixed for sync
This commit is contained in:
parent
5af80770ea
commit
a2becccaa8
|
@ -317,7 +317,6 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
//fmt.Println(columnName, isNullable, colType, colKey, extra, colDefault)
|
|
||||||
col.Name = strings.Trim(columnName, "` ")
|
col.Name = strings.Trim(columnName, "` ")
|
||||||
if "YES" == isNullable {
|
if "YES" == isNullable {
|
||||||
col.Nullable = true
|
col.Nullable = true
|
||||||
|
@ -467,15 +466,17 @@ func (db *mysql) GetIndexes(tableName string) (map[string]*core.Index, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
colName = strings.Trim(colName, "` ")
|
colName = strings.Trim(colName, "` ")
|
||||||
|
var isRegular bool
|
||||||
if strings.HasPrefix(indexName, "IDX_"+tableName) || strings.HasPrefix(indexName, "UQE_"+tableName) {
|
if strings.HasPrefix(indexName, "IDX_"+tableName) || strings.HasPrefix(indexName, "UQE_"+tableName) {
|
||||||
indexName = indexName[5+len(tableName) : len(indexName)]
|
indexName = indexName[5+len(tableName) : len(indexName)]
|
||||||
|
isRegular = true
|
||||||
}
|
}
|
||||||
|
|
||||||
var index *core.Index
|
var index *core.Index
|
||||||
var ok bool
|
var ok bool
|
||||||
if index, ok = indexes[indexName]; !ok {
|
if index, ok = indexes[indexName]; !ok {
|
||||||
index = new(core.Index)
|
index = new(core.Index)
|
||||||
|
index.IsRegular = isRegular
|
||||||
index.Type = indexType
|
index.Type = indexType
|
||||||
index.Name = indexName
|
index.Name = indexName
|
||||||
indexes[indexName] = index
|
indexes[indexName] = index
|
||||||
|
|
Loading…
Reference in New Issue