Skip to content

Commit 1e7bccc

Browse files
Guillermo Prandiguillep2klunnySijmenSchoon
committed
Exclude schema from index name (#65)
Exclude schema from the index name simple drone test fix column default value be empty (#59) Use https for gocover badge (#64) Co-authored-by: Guillermo Prandi <[email protected]> Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: SijmenSchoon <sijmenschoon@[email protected]> Reviewed-on: https://gitea.com/xorm/core/pulls/65 Reviewed-by: Lunny Xiao <[email protected]>
1 parent 6a6d853 commit 1e7bccc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ type Index struct {
2626
func (index *Index) XName(tableName string) string {
2727
if !strings.HasPrefix(index.Name, "UQE_") &&
2828
!strings.HasPrefix(index.Name, "IDX_") {
29-
tableName = strings.Replace(tableName, `"`, "", -1)
30-
tableName = strings.Replace(tableName, `.`, "_", -1)
29+
tableParts := strings.Split(strings.Replace(tableName, `"`, "", -1), ".")
30+
tableName = tableParts[len(tableParts)-1]
3131
if index.Type == UniqueType {
3232
return fmt.Sprintf("UQE_%v_%v", tableName, index.Name)
3333
}

0 commit comments

Comments
 (0)