remove scheme mysql:// prefix in sql.Open

This commit is contained in:
mattes 2014-10-11 01:37:00 +02:00
parent 95068e6a03
commit cb9cddce8e
1 changed files with 2 additions and 1 deletions

View File

@ -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
}