From 6612806e067b1f502e4f40d489156e3bb7b53636 Mon Sep 17 00:00:00 2001 From: Till Klocke Date: Thu, 16 Jun 2016 13:47:21 +0200 Subject: [PATCH] Crate driver was using wrong url scheme. The migrate CLI never had a chance to select the correct driver --- driver/crate/crate.go | 1 + driver/crate/crate_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/driver/crate/crate.go b/driver/crate/crate.go index 8773b66..faf4ef7 100644 --- a/driver/crate/crate.go +++ b/driver/crate/crate.go @@ -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 diff --git a/driver/crate/crate_test.go b/driver/crate/crate_test.go index 05367dd..1896432 100644 --- a/driver/crate/crate_test.go +++ b/driver/crate/crate_test.go @@ -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{}