* 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.
* Updated the columnRegexp to include decimals
* Update scope.go
Exporting sqlCommon as SQLCommon.
This allows passing alternate implementations of the database connection, or wrapping the connection with middleware. This change didn't change any usages of the database variables. All usages were already only using the functions defined in SQLCommon.
This does cause a breaking change in Dialect, since *sql.DB was referenced in the interface.
this fixes the logic of handling empty slice of int family in a query i.e something linke `[]int64{}`
This code snipped doesn't look like it was intended to be this way
```
if reflect.ValueOf(value).Len() > 0 {
str = fmt.Sprintf("(%v.%v NOT IN (?))", scope.QuotedTableName(), scope.Quote(primaryKey))
clause["args"] = []interface{}{value}
}
return ""
```
The `return ""` is always guaranteed to be executed regardless of whether the length of value is greater than 0. I believe the intended behavior is to return `""` when the length of value is zero.
The dialect must define its own foreign key generator method.
The previous default is available as a method on gorm.DefaultForeignKeyNamer
and can be embedded in other dialects.
The mysql dialect uses the first 24 characters plus an sha1 hash of the
full key name if the key name is more than 64 characters.