diff --git a/scope_private.go b/scope_private.go index 85f07e99..edd0dbe9 100644 --- a/scope_private.go +++ b/scope_private.go @@ -515,7 +515,11 @@ func (scope *Scope) addIndex(unique bool, indexName string, column ...string) { var columns []string for _, name := range column { - columns = append(columns, scope.Quote(name)) + if regexp.MustCompile("^[a-zA-Z]+$").MatchString(name) { + columns = append(columns, scope.Quote(name)) + } else { + columns = append(columns, name) + } } sqlCreate := "CREATE INDEX"