Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ...
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ mysql:
MYSQL_DATABASE: migratetest
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
cassandra:
image: cassandra:2.2
image: cassandra
crate:
image: crate
11 changes: 3 additions & 8 deletions driver/cassandra/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,14 @@ func (driver *Driver) Initialize(rawurl string) error {
Username: u.User.Username(),
Password: password,
}

}

driver.session, err = cluster.CreateSession()
if err != nil {
return err
}

if err := driver.ensureVersionTableExists(); err != nil {
return err
}

return nil
return driver.ensureVersionTableExists()
}

func (driver *Driver) Close() error {
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion driver/cassandra/cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ func TestMigrate(t *testing.T) {
if err := d.Close(); err != nil {
t.Fatal(err)
}

}

func resetKeySpace(session *gocql.Session) error {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const Version string = "1.3.2"
const Version string = "1.4.0"