增加websocket支持
This commit is contained in:
24
vendor/gorm.io/driver/postgres/postgres.go
generated
vendored
24
vendor/gorm.io/driver/postgres/postgres.go
generated
vendored
@@ -48,25 +48,19 @@ func (dialector Dialector) Name() string {
|
||||
}
|
||||
|
||||
func (dialector Dialector) Apply(config *gorm.Config) error {
|
||||
if config.NamingStrategy == nil {
|
||||
config.NamingStrategy = schema.NamingStrategy{
|
||||
IdentifierMaxLength: defaultIdentifierLength,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var namingStartegy *schema.NamingStrategy
|
||||
switch v := config.NamingStrategy.(type) {
|
||||
case *schema.NamingStrategy:
|
||||
if v.IdentifierMaxLength <= 0 {
|
||||
v.IdentifierMaxLength = defaultIdentifierLength
|
||||
}
|
||||
namingStartegy = v
|
||||
case schema.NamingStrategy:
|
||||
if v.IdentifierMaxLength <= 0 {
|
||||
v.IdentifierMaxLength = defaultIdentifierLength
|
||||
config.NamingStrategy = v
|
||||
}
|
||||
namingStartegy = &v
|
||||
case nil:
|
||||
namingStartegy = &schema.NamingStrategy{}
|
||||
}
|
||||
|
||||
if namingStartegy.IdentifierMaxLength <= 0 {
|
||||
namingStartegy.IdentifierMaxLength = defaultIdentifierLength
|
||||
}
|
||||
config.NamingStrategy = namingStartegy
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user