diff --git a/migrate.go b/migrate.go index 91be080..96609d9 100644 --- a/migrate.go +++ b/migrate.go @@ -87,9 +87,11 @@ func Migrate(db *sql.DB, version int, o Options, asset AssetFunc) error { } } - _, err = tx.Exec(`SET search_path TO ` + o.Schema + `,public`) - if err != nil { - return err + if o.Schema != `` { + _, err = tx.Exec(`SET search_path TO ` + o.Schema + `,public`) + if err != nil { + return err + } } err = tx.Commit()