fix: add const value for public scheam name of postgres. (#877)

This commit is contained in:
Bo-Yi Wu 2018-04-09 14:57:11 +08:00 committed by Lunny Xiao
parent 468154dfd5
commit 0b841796fa
2 changed files with 3 additions and 1 deletions

View File

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

View File

@ -551,7 +551,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
}