From 42f58417e9b4b2cd2a87184b2c0a75c0879f0d9a Mon Sep 17 00:00:00 2001 From: NiseVoid Date: Fri, 7 Jul 2017 12:35:46 +0200 Subject: [PATCH] Fix query error when no schema name was provided --- migrate.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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()