Updated scope.go to always quote when adding index
I am using numbers for column names (to be compatible with protobuf) and adding unique index to them does not work since they are not quoted. I do not see a reason to check if the column name is a string in order to quote it. Correct me if I am wrong.
This commit is contained in:
parent
eae7f6be60
commit
b16674c0f5
2
scope.go
2
scope.go
@ -1143,7 +1143,7 @@ func (scope *Scope) addIndex(unique bool, indexName string, column ...string) {
|
|||||||
|
|
||||||
var columns []string
|
var columns []string
|
||||||
for _, name := range column {
|
for _, name := range column {
|
||||||
columns = append(columns, scope.quoteIfPossible(name))
|
columns = append(columns, scope.Quote(name))
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlCreate := "CREATE INDEX"
|
sqlCreate := "CREATE INDEX"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user