From cb9cddce8e817d1ec07f9b57f62051788d59ec3a Mon Sep 17 00:00:00 2001 From: mattes Date: Sat, 11 Oct 2014 01:37:00 +0200 Subject: [PATCH] remove scheme mysql:// prefix in sql.Open --- driver/mysql/mysql.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver/mysql/mysql.go b/driver/mysql/mysql.go index d0be043..9ae8dc9 100644 --- a/driver/mysql/mysql.go +++ b/driver/mysql/mysql.go @@ -12,6 +12,7 @@ import ( "github.com/mattes/migrate/migrate/direction" "regexp" "strconv" + "strings" ) type Driver struct { @@ -21,7 +22,7 @@ type Driver struct { const tableName = "schema_migrations" func (driver *Driver) Initialize(url string) error { - db, err := sql.Open("mysql", url) + db, err := sql.Open("mysql", strings.TrimLeft(url, "mysql://")) if err != nil { return err }