Crate driver was using wrong url scheme. The migrate CLI never had a chance to select the correct driver

This commit is contained in:
Till Klocke 2016-06-16 13:47:21 +02:00
parent a7fa9eb3fb
commit 6612806e06
2 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ type Driver struct {
const tableName = "schema_migrations"
func (driver *Driver) Initialize(url string) error {
url = strings.Replace(url, "crate", "http", 1)
db, err := sql.Open("crate", url)
if err != nil {
return err

View File

@ -14,7 +14,7 @@ func TestMigrate(t *testing.T) {
host := os.Getenv("CRATE_PORT_4200_TCP_ADDR")
port := os.Getenv("CRATE_PORT_4200_TCP_PORT")
url := fmt.Sprintf("http://%s:%s", host, port)
url := fmt.Sprintf("crate://%s:%s", host, port)
driver := &Driver{}