mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-04 05:36:35 +08:00
refactor:获取表索引,默认过滤主键索引
This commit is contained in:
@@ -324,18 +324,10 @@ func (app *dbTransferAppImpl) transferIndex(_ context.Context, tableInfo dbi.Tab
|
||||
return nil
|
||||
}
|
||||
|
||||
// 过滤主键索引
|
||||
idxs := make([]dbi.Index, 0)
|
||||
for _, idx := range indexs {
|
||||
if !idx.IsPrimaryKey {
|
||||
idxs = append(idxs, idx)
|
||||
}
|
||||
}
|
||||
|
||||
if len(idxs) == 0 {
|
||||
if len(indexs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 通过表名、索引信息生成建索引语句,并执行到目标表
|
||||
return targetDialect.CreateIndex(tableInfo, idxs)
|
||||
return targetDialect.CreateIndex(tableInfo, indexs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user