Explorar o código

add const value for public scheam name of postgres

xormplus %!s(int64=7) %!d(string=hai) anos
pai
achega
23ae16d3cf
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 2 0
      dialect_postgres.go
  2. 1 1
      engine.go

+ 2 - 0
dialect_postgres.go

@@ -769,6 +769,8 @@ var (
 	DefaultPostgresSchema = "public"
 )
 
+const postgresPublicSchema = "public"
+
 type postgres struct {
 	core.Base
 }

+ 1 - 1
engine.go

@@ -560,7 +560,7 @@ func (engine *Engine) tbSchemaName(v string) string {
 	// Only for postgres database.
 	if engine.dialect.DBType() == core.POSTGRES &&
 		engine.dialect.URI().Schema != "" &&
-		engine.dialect.URI().Schema != DefaultPostgresSchema &&
+		engine.dialect.URI().Schema != postgresPublicSchema &&
 		strings.Index(v, ".") == -1 {
 		return engine.dialect.URI().Schema + "." + v
 	}