fix mysql

This commit is contained in:
mattes 2014-10-17 11:50:39 -07:00
parent 5b6715333f
commit c1f0a1a044
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/mattes/migrate/file"
"github.com/mattes/migrate/migrate/direction"
pipep "github.com/mattes/migrate/pipe"
"strings"
"testing"
)
@ -14,7 +15,7 @@ func TestMigrate(t *testing.T) {
driverUrl := "mysql://root@tcp(127.0.0.1:3306)/migratetest"
// prepare clean database
connection, err := sql.Open("mysql", driverUrl)
connection, err := sql.Open("mysql", strings.SplitN(driverUrl, "mysql://", 2)[1])
if err != nil {
t.Fatal(err)
}