Fix postgres schema problem

This commit is contained in:
Lunny Xiao 2020-03-24 09:42:37 +08:00
parent 6132eea08c
commit 4ed8bf3527
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
3 changed files with 0 additions and 10 deletions

View File

@ -43,7 +43,6 @@ type Dialect interface {
URI() *URI
SQLType(*schemas.Column) string
FormatBytes(b []byte) string
DefaultSchema() string
IsReserved(string) bool
Quoter() schemas.Quoter
@ -83,10 +82,6 @@ func (b *Base) Quoter() schemas.Quoter {
return b.quoter
}
func (b *Base) DefaultSchema() string {
return ""
}
func (b *Base) Init(dialect Dialect, uri *URI) error {
b.dialect, b.uri = dialect, uri
return nil

View File

@ -817,10 +817,6 @@ func (db *postgres) SetQuotePolicy(quotePolicy QuotePolicy) {
}
}
func (db *postgres) DefaultSchema() string {
return postgresPublicSchema
}
func (db *postgres) SQLType(c *schemas.Column) string {
var res string
switch t := c.SQLType.Name; t {

View File

@ -18,7 +18,6 @@ func TableNameWithSchema(dialect Dialect, tableName string) string {
// Add schema name as prefix of table name.
// Only for postgres database.
if dialect.URI().Schema != "" &&
dialect.URI().Schema != dialect.DefaultSchema() &&
strings.Index(tableName, ".") == -1 {
return fmt.Sprintf("%s.%s", dialect.URI().Schema, tableName)
}