diff --git a/Makefile b/Makefile index da05db3..96e74bc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ IMAGE=gemnasium/migrate DCR=docker-compose run --rm -.PHONY: clean test build release docker-build docker-push run +.PHONY: all clean test build release docker-build docker-push all: release diff --git a/README.md b/README.md index c16e100..7ab9617 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,16 @@ A migration helper written in Go. Use it in your existing Golang code or run commands via the CLI. ``` -GoCode import github.com/gemnasium/migrate/migrate +Go code import "github.com/gemnasium/migrate/migrate" CLI go get -u github.com/gemnasium/migrate ``` __Features__ * Super easy to implement [Driver interface](http://godoc.org/github.com/gemnasium/migrate/driver#Driver). -* Gracefully quit running migrations on ``^C``. +* Gracefully quit running migrations on `^C`. * No magic search paths routines, no hard-coded config files. -* CLI is build on top of the ``migrate package``. +* CLI is build on top of the `migrate` package. ## Available Drivers @@ -85,7 +85,7 @@ import _ "github.com/gemnasium/migrate/driver/mysql" allErrors, ok := migrate.UpSync("driver://url", "./path") if !ok { fmt.Println("Oh no ...") - // do sth with allErrors slice + // do something with allErrors slice } // use the asynchronous version of migration functions ... @@ -107,7 +107,7 @@ The format of migration files looks like this: ... ``` -Why two files? This way you could still do sth like +Why two files? This way you could still do something like ``psql -f ./db/migrations/20060102150405_initial_plan_to_do_sth.up.sql`` and there is no need for any custom markup language to divide up and down migrations. Please note that the filename extension depends on the driver. diff --git a/docker-compose.yml b/docker-compose.yml index 6ec3003..06f4d52 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,6 @@ mysql: MYSQL_DATABASE: migratetest MYSQL_ALLOW_EMPTY_PASSWORD: "yes" cassandra: - image: cassandra:2.2 + image: cassandra crate: image: crate diff --git a/driver/cassandra/cassandra.go b/driver/cassandra/cassandra.go index e6a05e6..1588ea3 100644 --- a/driver/cassandra/cassandra.go +++ b/driver/cassandra/cassandra.go @@ -68,7 +68,6 @@ func (driver *Driver) Initialize(rawurl string) error { Username: u.User.Username(), Password: password, } - } driver.session, err = cluster.CreateSession() @@ -76,11 +75,7 @@ func (driver *Driver) Initialize(rawurl string) error { return err } - if err := driver.ensureVersionTableExists(); err != nil { - return err - } - - return nil + return driver.ensureVersionTableExists() } func (driver *Driver) Close() error { @@ -164,8 +159,8 @@ func init() { driver.RegisterDriver("cassandra", &Driver{}) } -// ParseConsistency wraps gocql.ParseConsistency to return an error -// instead of a panicing. +// parseConsistency wraps gocql.ParseConsistency to return an error +// instead of a panicking. func parseConsistency(consistencyStr string) (consistency gocql.Consistency, err error) { defer func() { if r := recover(); r != nil { diff --git a/driver/cassandra/cassandra_test.go b/driver/cassandra/cassandra_test.go index 5f1a1ba..f53c405 100644 --- a/driver/cassandra/cassandra_test.go +++ b/driver/cassandra/cassandra_test.go @@ -149,7 +149,6 @@ func TestMigrate(t *testing.T) { if err := d.Close(); err != nil { t.Fatal(err) } - } func resetKeySpace(session *gocql.Session) error { diff --git a/version.go b/version.go index 2791b0e..38a9c64 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package main -const Version string = "1.3.2" +const Version string = "1.4.0"