Coder Social home page Coder Social logo

migrate's Introduction

migrate

Database migrations written in Go. Use as CLI or import as library.

DEPRECATED

mattes/migrate is now golang-migrate/migrate

Please open issues and pull requests in the new repository.

migrate's People

Contributors

balboah avatar benmoss avatar buddhamagnet avatar christianklotz avatar dacamp avatar daddykotex avatar dereulenspiegel avatar dimag-jfrog avatar dinedal avatar divan avatar divoxx avatar fln avatar fsouza avatar glowcone avatar jamiecuthill avatar jensrantil avatar jmhodges avatar johnweldon avatar justinas avatar kshvakov avatar martin-magakian avatar mattes avatar maxvw avatar ngauthier avatar raizyr avatar skeswa avatar taywrobel avatar tinysquare avatar uzimonkey avatar watersofoblivion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

migrate's Issues

MySQL Driver takes a long time to compile

Incorporating this project into my own has caused compilation to take 30-ish seconds or more. The root cause is compiling the Go MySQL driver, which seems to compile C code it needs.

Since I'm using Postgres, this is a pain. Is there any way to make that dependency optional?

Make migrate up auto-detect Cassandra keyspace

Nice tool

Please make migrate auto detect the Cassandra keyspace when executing CQL script.

For example, this doesn't work
CREATE TABLE test(id text)

This works:
CREATE TABLE keyspace.test(id text)

Alternatively, add -k option to migrate cli

Segmentation fault on Alpine Linux

You can replicate it by running:

  • docker run -it golang:1.5.2-alpine sh
  • apk add --update git alpine-sdk
  • go get github.com/mattes/migrate
  • migrate

From what I've tried, it doesn't happen on OSX, Ubuntu or Debian.

Allow other migration providers besides filesystem

I'm using migrate as a library for Go application. I want to be able to distribute the migrations as bindata inside of the application, rather than distribute migration files, but the migrate library is tightly coupled to the filesystem.

It'd be good if migrate were refactored to have a MigrationProvider interface that was used to return the File type, rather than forcing use of physical files.

panic: sql: Register called twice for driver postgres - Using migrate inside go alongside other database code

I'm trying to use the migrations alongside some other SQL code, and it looks like the Postgres driver is fighting itself in the database/sql module.

panic: sql: Register called twice for driver postgres

goroutine 1 [running]:
panic(0x4d7cc0, 0xc820079700)
    /Users/micah/Developer/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6
database/sql.Register(0x68d1a0, 0x8, 0xf04ac8, 0x97cc48)
    /Users/micah/Developer/Cellar/go/1.6.2/libexec/src/database/sql/sql.go:45 +0x181
github.com/lib/pq.init.1()
    /Users/micah/sandboxes/go/src/github.com/lib/pq/conn.go:44 +0x71
github.com/lib/pq.init()
    /Users/micah/sandboxes/go/src/github.com/lib/pq/user_posix.go:24 +0x4b0
github.com/mattes/migrate/driver/postgres.init()
    /Users/micah/sandboxes/go/src/github.com/mattes/migrate/driver/postgres/postgres.go:127 +0x4a

It's definitely related to

import _ "github.com/mattes/migrate/driver/postgres"

but I'm not really sure what to do to get around it. For now, I think I'll just shell out to run migrate via the shell.

Postgres custom schema flag in url

# TODO: thinking about adding some custom flag to allow migration within schemas:
-url="postgres://user@host:port/database?schema=name" 

go build is hanging there

Have no idea why, but it takes forever to build the project.

❯ go build -v                                        [INS]
github.com/mattes/migrate/migrate/direction
github.com/mattes/migrate/pipe
github.com/mattes/migrate/file
github.com/mattes/migrate/driver
github.com/mattes/migrate/driver/bash
github.com/mattes/migrate/driver/cassandra
github.com/mattes/migrate/driver/mysql
github.com/mattes/migrate/driver/postgres
github.com/mattes/migrate/driver/sqlite3
github.com/mattes/migrate/migrate
github.com/mattes/migrate (Hang here)

 ❯ go version                                         [INS]
go version go1.6.2 darwin/amd64

Support Cassandra 3.0

gocql has support for cassandra 3.0.0 if you set the protocol version with something like this:

cluster := gocql.NewCluster(hosts)
cluster.ProtoVersion = 4
cluster.CreateSession()

I started testing in a fork, but the build process is having issues with the change in how 6g is built in go1.5 (via go tool compile). I'll dig into that sometime tonight when I have time.

Unable to connect to Cassandra

./migrate -url cassandra://127.0.0.1:9042/migs create migration_file_xyz
2016/07/01 11:38:44 gocql: unable to dial control conn 127.0.0.1:9042: gocql: no response received from cassandra within timeout period
gocql: unable to create session: control: unable to connect to initial endpoints

I have Cassandra running on locahost:9042
$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.5 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh> exit

Support go code migrations

Would be nice to be able to do migrations using go code instead of just plain SQL. If for instance you add a column whose value needs to be calculated in some way that can't be done with just SQL. This is the only thing preventing me from using this library over something like https://github.com/CloudCom/goose

Remove dependency on all drivers

The current setup loads all drivers, rather than having them loaded by the end user. This means that any dependency which requires CGO to build -- and is therefore not able to be cross-compiled. This seems to be the case for at least the PostgreSQL and Sqlite3 drivers.

I'm seeing this paradigm in the driver code : https://github.com/mattes/migrate/blob/master/driver/driver.go

Instead of calling a single driver.New() method, it might make more sense to have a New() method implemented by each driver?

Migration file id clash across branches

I'm running into some trouble and am not sure what the best solution for it is.
Here's the scenario:

  1. Let's say developer A branches off staging to work on feature1
  2. Developer B branches off staging to work on feature2
  3. Current number of migrations on staging are 3
  4. Developer A creates a migration file - which gets id 4 ie. named 0004_xxx.(up|down).sql
  5. Developer B creates a migration file too which gets id 4 too
  6. Developer A's pull request gets merged first.
  7. Developer B's pull request gets merged second.
  8. This means staging now has 2 migration file sets (up + down) with the same prefix.
  9. Next time someone pulls down staging and runs the migrate command, only one of the 2 migration up files with prefix 0004 gets run.

Simple fix seems to be to use timestamps as prefixes. What's the best way of setting that up?

0 Exit code on failure to connect

I'm using migrate on CI, and if migrate fails to connect to the database it will still exit 0, which confuses CI. For example:

$ migrate -url postgres://bad up
dial tcp: lookup bad: no such host 


0.0266 seconds
$ echo $?

It seems that when writePipe encounters and error on the pipe it does not return it:

https://github.com/mattes/migrate/blob/master/main.go#L146

Which means that when a command is run, like up, it cannot handle an error and os.Exit(1):

https://github.com/mattes/migrate/blob/master/main.go#L97

IMO a failure to connect to the db or a failure on the pipe should be a non zero exit. But I am also not sure if there could be failures on the pipe that would not actually be failures on the migration.

Cheers, and thanks for the library!

Timestamps instead of auto increments

Auto increments are fine for one-man show, but they become a big problem in a team of hundred people doing several migrations a day. DB version just start clashing.

Password authentication failed (PostgreSQL 9.3)

Hi.

I am facing with DB password authentication failure issue when I run this command:

sardor@geekbot:~/.gvm/pkgsets/go1.4/global/src/github.com/go-bootstrap/go-bootstrap$ migrate -url postgres://sardor:qwe123@localhost:5432/goweb?sslmode=disable -path /home/sardor/.gvm/pkgsets/go1.4/global/src/github.com/go-bootstrap/go-bootstrap/ up
pq: password authentication failed for user "sardor" 


0.0049 seconds

I was using migrate with go-bootstrap and it's author also points here in his comment

This is postgresql user sardor which was set as superuser:

sardor@geekbot:~/.gvm/pkgsets/go1.4/global/src/github.com/go-bootstrap/go-bootstrap$ sudo su postgres
postgres@geekbot:/home/sardor/.gvm/pkgsets/go1.4/global/src/github.com/go-bootstrap/go-bootstrap$ psql
psql (9.3.6)
Type "help" for help.

postgres=# \du
                              List of roles
  Role name  |                   Attributes                   | Member of 
-------------+------------------------------------------------+-----------
 digmaster   |                                                | {}
 drivers     |                                                | {}
 login       |                                                | {}
 newsdig     |                                                | {}
 postgres    | Superuser, Create role, Create DB, Replication | {}
 sardor      | Superuser, Create role, Create DB, Replication+| {}
             | Password valid until 2015-05-08 00:00:00+09    | 
 tarjimonlar |                                                | {}
 test        |                                                | {}

OS: Ubuntu 14.04.2 LTS
PostgreSQL: 9.3.6
Go: 1.4

What might be the reason for it? Or postgresql configuration is not correct?

This is my pg_hba.conf:

root@geekbot:~# grep sardor /etc/postgresql/9.3/main/pg_hba.conf                                                                                          
local   all             sardor                                  trust

Tried with different methods:

root@geekbot:~# grep sardor /etc/postgresql/9.3/main/pg_hba.conf 
local   all             sardor                                  ident

No success.

Any suggestions?

Semantic versioning for migrations

Instead of naming my migration files like so: 001_hello.up.sql. I would much rather use semantic versioning to name my migrations, e.g. 1.0.0.up.sql. All the files are still in the correct alphabetical order, but migrate won't recognize these files.

Make output nicer

Right now the output looks like:

migrate -url postgres://localhost/migratetest3?sslmode=disable reset
< 0016_hello.down.sql
< 0015_hello.down.sql
< 0014_hello.down.sql
< 0013_hello.down.sql
< 0012_hello.down.sql
< 0011_hello.down.sql
< 0010_hello.down.sql
< 0009_hello.down.sql
< 0008_hello.down.sql
< 0007_hello.down.sql
< 0006_hello.down.sql
< 0005_hello.down.sql
< 0004_hello.down.sql
< 0003_hello.down.sql
< 0002_peng.down.sql
< 0001_initial.down.sql
> 0001_initial.up.sql
> 0002_peng.up.sql
> 0003_hello.up.sql
> 0004_hello.up.sql
> 0005_hello.up.sql
> 0006_hello.up.sql
> 0007_hello.up.sql
> 0008_hello.up.sql
> 0009_hello.up.sql
> 0010_hello.up.sql
> 0011_hello.up.sql
> 0012_hello.up.sql
> 0013_hello.up.sql
> 0014_hello.up.sql
> 0015_hello.up.sql
> 0016_hello.up.sql

10.0433 seconds

Support for containerized migrate and multi-dbs

Thank you very much for this spiffy little project. I was working with a multi-tenant data warehouse and I needed to be able to perform migrations on several databases.

I hacked up the following Dockerfile and docker-entrypoint.sh script to help with that, and I thought I'd share them in case they are of use to you or someone else, or just give you ideas. :) It might also help @JensRantil in issue #98. He could have a series of migration folders set up and be able to perform the migrations in the proper order:

  ▾ migrations/
    ▾ 001_db_postgres/
    ▾ 002_db_template_tenant/
        0001_application_schema.down.sql
        0001_application_schema.up.sql
        0002_initial_extensions.down.sql
        0002_initial_extensions.up.sql
        0003_initial_datetime.down.sql
        0003_initial_datetime.up.sql
    ▾ 003_db_multitenant/
        0001_extension_pgcrypto.down.sql
        0001_extension_pgcrypto.up.sql
    ▾ 004_db_template_tenant/
        0004_initial_users.down.sql
        0004_initial_users.up.sql

I don't think it would work perfectly because migrate might get confused about the version if running only in 002_db or 004_db, but it is a start.

Archive.zip

Broken exit code

I didn't spend time yet digging into the changes, but it seems the recent "exit code" fixes has made my migrations always return exit code 1 with no apparent reason.

[ root@d0832af343c0:/app ]$ /app/bin/migrate -url cassandra://172.17.0.28/appdata -path /app/migrations up
> 0001_CreatePackets.up.cql
> 0002_CreateApps.up.cql
> 0003_IndexAppsMark.up.cql
> 0004_DefaultApps.up.cql
> 0005_CreateAccessPlans.up.cql
> 0006_ActivePlans.up.cql
> 0007_ActiveApps.up.cql

1.2445 seconds
[ root@d0832af343c0:/app ]$ echo $?
1

Support for cassandra udt

How difficult would supporting something like this be. The hard part to me would seem to be requiring the existence of udts between versions.

Driver 'postgres' not found. using CLI

Haven't updated anything server side recently, but all of a sudden am running into a missing postgres driver error on my CI server

Semaphore: ~/tagkey-backend $ psql tagkey_test
psql (9.4.5)
Type "help" for help.

tagkey_test=# \q
Semaphore: ~/tagkey-backend $ echo $DATABASE_URL
postgres://runner:semaphoredb@localhost/tagkey_test?sslmode=disable
Semaphore: ~/tagkey-backend $   migrate -path=./sql -url=$DATABASE_URL up
Driver 'postgres' not found. 


0.0008 seconds
Connection to 136.243.35.101 closed.

Move drivers to own repository

When go getting or using a package manager, migrate comes with all current drivers which trigger recursive gets on their dependencies. One will end up with unneeded database drivers. A better solution would be like database/sql does. We could then do

go get github.com/mattes/migrate
go get github.com/mattes/migrate-drivers/postgres

And end up with only the postgres driver (and dependencies) instead of the whole bunch

Can't execute mysql migration with semicolon in it

I am trying to create a migration which adds a trigger to the database. The trigger creation statement contains a semicolon (;). However the mysql migrator splits the input migration file on semicolons, and treats them as separate statements. Because of this I get a syntax error when trying to run the migration.

For example:

create trigger test_insert after insert on test
for each row
begin
    insert into test_event set type='insert', test_id=NEW.id;
end
Error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4

1: create trigger test_insert after insert on test
2: for each row
3: begin
4:  insert into test_event set type='insert', test_id=NEW.id

all cassandra migrate commands take 3+ minutes to execute

I could have something configured wrong, but every command that I run through migrate takes very slightly over 3 minutes to run. This example migration does a simple select on an empty table:

migrate -url cassandra://192.168.99.100/items -path ./migrations migrate +1
> 0001_foobar.up.cql

3.0054 minutes

This create statement is just making a new set of cql files in the migrations directory:

time migrate -url cassandra://192.168.99.100/items -path ./migrations create foobar3
Version 3 migration files created in ./migrations:
0003_foobar3.up.cql
0003_foobar3.down.cql
migrate -url cassandra://192.168.99.100/items -path ./migrations create   0.01s user 0.02s system 0% cpu 3:00.28 total

I'm running against a docker container using this docker-compose.yml file and the IP above is the docker-machine ip default value:

cassandra:
  image: library/cassandra:2.2.3
  ports:
    - "9160:9160"
    - "9042:9042"
  volumes:
    - ./migrations:/migrations

It feels like there's some sort of timeout going on within the migrate command or the gocql stuff. Interaction with the cassandra instance via cqlsh is speedy and normal, example running cqlsh directly inside the docker container:

time docker exec -it migratetest_cassandra_1 cqlsh -f migrations/0001_foobar.up.cql

 count
-------
     0

(1 rows)

Warnings :
Aggregation query used without partition key

docker exec -it migratetest_cassandra_1 cqlsh -f migrations/0001_foobar.up.cql  0.14s user 0.01s system 25% cpu 0.563 total

Has anyone seen weird 3 minute pauses with the cassandra migrate driver?

Passing existing *sql.DB to migrate

I'm trying to pass an existing *sql.DB to migrate for integration testing purposes. This isn't necessary with most databases, but it is needed with sqlite's :memory: database.

So maybe we could have 3 new functions that take sql.DB pointers instead of URLs, like this:

UpSyncWithDB(db *sql.DB, migrationsPath string) (err []error, ok bool)
DownSyncWithDB(db *sql.DB, migrationsPath string) (err []error, ok bool)
ResetSyncWithDB(db *sql.DB, migrationsPath string) (err []error, ok bool)

What do you think?

Postgres DB connection not closed after migrations?

Migrate does not seem to close the database after running migrations.

Might not be issue for most usage, but in my case, it is, as I am trying to use temporary databases for testing that are destroyed afterwards. Right now, I can't do this, because dropping a database with open connections to it is... tricky.

I think this could be done with Driver having a Close (Cleanup, ...?) method that would be called after migrations by Up, Down, etc.

Unique driver FilenameExtension()

Drivers like PostgreSQL, MySQL, ... would usually expect migration files that end with .sql. This might be a problem in ReadMigrationFiles(..) (link) where it scans a directory for files with the given filename extension regex.

Maybe we should drop the filename extension parsing and just use all files from that given directory?

UpSync doesn't tell if migrations have been run

Hello, and thanks for migrate! I am using it as a library, but it is awfully silent when successful. I'd be interested to know, if there is no errors, if any migrations have actually been run, and if possible, which files. Additional information such as how long each took wouldn't hurt either :)

As to "Were any migrations run" and "how many" we could return an array of nil errors instead of just nil if the migration has been successful, and generally throw "nil" in the pipe if a migration works fine.

A larger refactor would be to throw a "MigrationResult struct { error, time.Duration}" or similar in the pipe instead of an error.. Would you consider such a pull request? What do you think would be a good solution?

Thanks!

I must be doing something stupid...

A program very similar to this used to work maybe a year ago. After updating with go get -u it now does not find the sqlite3 driver: "Driver 'sqlite3' not found." What am I doing wrong?

( I updated both the go-sqlite3 driver and the migrate library to make sure I had the latest. Thank you in advance for helping a poor sod. :-)

package main

import (
    "github.com/mattes/migrate/migrate"
    _ "github.com/mattn/go-sqlite3"
    "log"
)

func main() {
    allErrors, ok := migrate.ResetSync("sqlite3://temp.db", "./migrations")
    if !ok {
        log.Println("Error migrating schema", allErrors)
        return
    }
}

SQLite3 driver slows down build time

Using migrate package with this commit 8d39928

sees a slowdown on build time.

$ time godep go build                                                                                
godep go build  18.62s user 0.93s system 107% cpu 18.171 total

Compared to the build before the sqlite driver was added:

$ time go build
go build  0.55s user 0.09s system 97% cpu 0.660 total

That's a sever slowdown for apps that don't use sqlite

[Question] are go migrations planned?

Hey @mattes I want to ask if there is a plan to support go migrations like in the Goose library,
at work we are needing to convert data from different formats and it would be cool if there is a way to do this using go migrations.

Anyway, if there is no plan and as we are needing this, would you accept a PR to add support for it ?
we are planing to take this effort for ourself if needed.

sqlite3.go is included even when not needed.

The database I am using is PostgreSQL and I got this error when calling migrate upSync method:

../../mattes/migrate/driver/sqlite3/sqlite3.go:10:2: C source files not allowed when not using cgo: sqlite3-binding.c

The error breaks GOOS=linux go build on darwin machine. Is it possible to include driver only when needed?

For example, instead of having 1 constructor that handles them all here: https://github.com/mattes/migrate/blob/master/driver/driver.go#L44, maybe you can have 1 constructor per driver file.

`migrate` fails on Travis CI

Hi; I have a little API I'm writing and trying to test on Travis using a test database. Migrations that run locally don't seem to work on Travis, but no descriptive error ends up being output. Here's a log from Travis:

Using worker: worker-linux-14-2.bb.travis-ci.com:travis-linux-18
system_info
Build system information
Build language: go
Build image provisioning date and time
Sun Dec 14 02:51:49 UTC 2014
lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 12.04 LTS
Release:    12.04
Codename:   precise
Cookbooks Version
4f2272c https://github.com/travis-ci/travis-cookbooks/tree/4f2272c
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LLVM version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ruby-1.9.3-p551
Pre-installed Node.js versions
v0.10.33
Pre-installed Go versions
go1
go1.0
go1.0.3
go1.1
go1.1.2
go1.2
go1.2.2
go1.3
go1.3.3
go1.4
Redis version
redis-server 2.8.18
riak version
1.4.12
MongoDB version
MongoDB 2.4.12
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
Cassandra version
2.0.9
RabbitMQ Version
3.4.2
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.4
Default Sphinx version
2.1.9
Installed Firefox version
firefox 31.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T20:58:10+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_72, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-042stab090.5", arch: "amd64", family: "unix"
Installing an SSH key from: default repository key
Key fingerprint: 98:43:1a:5f:72:81:49:76:42:a3:37:84:d0:b4:86:ff
git.checkout
0.33s$ git clone --depth=50 --branch=master [email protected]:davidcelis/api.rubbi.sh.git davidcelis/api.rubbi.sh
Cloning into 'davidcelis/api.rubbi.sh'...
Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.
remote: Counting objects: 32, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 32 (delta 7), reused 29 (delta 6)
Receiving objects: 100% (32/32), 5.38 KiB | 0 bytes/s, done.
Resolving deltas: 100% (7/7), done.
Checking connectivity... done.
$ cd davidcelis/api.rubbi.sh
$ git checkout -qf 67594971c68b00e5d185de65f00caef0d4f2e726
postgresql
Starting PostgreSQL v9.3
1.36s$ sudo service postgresql stop
 * Stopping PostgreSQL 9.1 database server        * Stopping PostgreSQL 9.2 database server        * Stopping PostgreSQL 9.3 database server       2.24s$ sudo service postgresql start 9.3
 * Starting PostgreSQL 9.3 database server       
gvm.get
0.31s$ gvm get
Your branch is up-to-date with 'origin/master'.
Already up-to-date.
gvm.update
1.17s$ gvm update && source $HOME/.gvm/scripts/gvm
pulling from https://go.googlecode.com/hg/
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
(run 'hg update' to get a working copy)
gvm.install
0.07s$ gvm install go1.3.3 --binary || gvm install go1.3.3
Already installed!
0.03s$ gvm use go1.3.3
Now using version go1.3.3
$ export GOPATH=$HOME/gopath:$GOPATH
$ export PATH=$HOME/gopath/bin:$PATH
$ mkdir -p $HOME/gopath/src/github.com/davidcelis/api.rubbi.sh
$ rsync -az ${TRAVIS_BUILD_DIR}/ $HOME/gopath/src/github.com/davidcelis/api.rubbi.sh/
$ export TRAVIS_BUILD_DIR=$HOME/gopath/src/github.com/davidcelis/api.rubbi.sh
$ cd $HOME/gopath/src/github.com/davidcelis/api.rubbi.sh
$ gvm version
Go Version Manager v1.0.22 installed at /home/travis/.gvm
$ go version
go version go1.3.3 linux/amd64
go.env
$ go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/travis/gopath:/home/travis/.gvm/pkgsets/go1.3.3/global"
GORACE=""
GOROOT="/home/travis/.gvm/gos/go1.3.3"
GOTOOLDIR="/home/travis/.gvm/gos/go1.3.3/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
install
1.46s$ go get -t -v ./...
github.com/lib/pq (download)
github.com/lib/pq/oid
github.com/lib/pq
github.com/davidcelis/api.rubbi.sh/data
github.com/davidcelis/api.rubbi.sh/cmd/rubbish-api
before_script.1
0.02s$ createuser -s -l -d rubbish
before_script.2
0.23s$ createdb -U rubbish -O rubbish rubbish_test
before_script.3
5.78s$ go get github.com/mattes/migrate
0.98s$ migrate -url 'postgres://rubbish@localhost/rubbish_test?sslmode=disable' -path ./migrations up
> 0001_create_containers.up.sql
> 0002_add_coordinate_constraints_to_containers.up.sql
0.9699 seconds
The command "migrate -url 'postgres://rubbish@localhost/rubbish_test?sslmode=disable' -path ./migrations up" failed and exited with 1 during .
Your build has been stopped.

So it appears that the migrations finish, but then something causes the command to exit 1 without any usable output. Not sure how I should further debug this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.