Fix postgres schema problem
This commit is contained in:
parent
6132eea08c
commit
4ed8bf3527
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue