(uniqueIndex map[string][]*Field, tableName string)
| 172 | } |
| 173 | |
| 174 | func checkDuplicateUniqueIndex(uniqueIndex map[string][]*Field, tableName string) { |
| 175 | log := console.NewColorConsole() |
| 176 | uniqueSet := collection.NewSet[string]() |
| 177 | for k, i := range uniqueIndex { |
| 178 | var list []string |
| 179 | for _, e := range i { |
| 180 | list = append(list, e.Name.Source()) |
| 181 | } |
| 182 | |
| 183 | joinRet := strings.Join(list, ",") |
| 184 | if uniqueSet.Contains(joinRet) { |
| 185 | log.Warning("[checkDuplicateUniqueIndex]: table %s: duplicate unique index %s", tableName, joinRet) |
| 186 | delete(uniqueIndex, k) |
| 187 | continue |
| 188 | } |
| 189 | |
| 190 | uniqueSet.Add(joinRet) |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | func convertColumns(columns []*parser.Column, primaryColumn string, strict bool) (Primary, map[string]*Field, error) { |
| 195 | var ( |
no test coverage detected
searching dependent graphs…