1

I've developed a web app using Go, which I've deployed to Heroku. I'm using mattes/migrate to manage migrations. It works great locally, but the migrate command-line binary isn't available when I deploy to Heroku.

The only binaries that are included are my own. Is there a way to have Godeps compile and install binaries provided by a dependency?

Christian Niles
  • 331
  • 4
  • 8
  • I've come across an issue in the Godep repo which exactly describes the issue I'm having as well. https://github.com/tools/godep/issues/306 – Christian Niles Nov 21 '15 at 18:58
  • You could also run `migrate` against your Heroku Postgres DB remotely from your dev machine. – elithrar Nov 22 '15 at 01:13

2 Answers2

0

Just create a file where you include the executable path.

See this issue for Goose (mattes/migrate competitor)

I'd expect the equivalent for mattes/migrate would be:

package main

import _ "github.com/mattes/migrate"
David Budworth
  • 11,248
  • 1
  • 36
  • 45
0

Heroku's current recommended solution is to simply clone the command into your own repo (see github.com/tools/godep/issues/306).

I copied the mattes/migrate/main.go into the cmd/migrate directory in my own project. This builds the command just like my own server command.

It's not ideal, but it works.

Christian Niles
  • 331
  • 4
  • 8