!116 fix: 新版本问题修复

* fix: 新版本问题修复
This commit is contained in:
zongyangleo
2024-04-19 11:27:29 +00:00
committed by Coder慌
parent 2a6d620830
commit 44805ce580
12 changed files with 80 additions and 73 deletions

View File

@@ -194,7 +194,7 @@ func (md *MysqlMetaData) GenerateIndexDDL(indexs []dbi.Index, tableInfo dbi.Tabl
colNames[i] = meta.QuoteIdentifier(name)
}
sqlTmp := "ALTER TABLE %s ADD %s INDEX %s(%s) USING BTREE"
sqlStr := fmt.Sprintf(sqlTmp, meta.QuoteIdentifier(tableInfo.TableName), unique, index.IndexName, strings.Join(colNames, ","))
sqlStr := fmt.Sprintf(sqlTmp, meta.QuoteIdentifier(tableInfo.TableName), unique, meta.QuoteIdentifier(index.IndexName), strings.Join(colNames, ","))
comment := meta.QuoteEscape(index.IndexComment)
if comment != "" {
sqlStr += fmt.Sprintf(" COMMENT '%s'", comment)