Fix query error when no schema name was provided

This commit is contained in:
Nise Void 2017-07-07 12:35:46 +02:00
parent 0ebacc4842
commit 42f58417e9

View File

@ -87,10 +87,12 @@ func Migrate(db *sql.DB, version int, o Options, asset AssetFunc) error {
} }
} }
if o.Schema != `` {
_, err = tx.Exec(`SET search_path TO ` + o.Schema + `,public`) _, err = tx.Exec(`SET search_path TO ` + o.Schema + `,public`)
if err != nil { if err != nil {
return err return err
} }
}
err = tx.Commit() err = tx.Commit()
if err != nil { if err != nil {