From e3238c19c31015663616941d2919f4835cf00a60 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Tue, 20 Feb 2018 23:21:56 -0800 Subject: [PATCH] remove route-runmigraions --- cmd/route-runmigrations/main.go | 43 --------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 cmd/route-runmigrations/main.go diff --git a/cmd/route-runmigrations/main.go b/cmd/route-runmigrations/main.go deleted file mode 100644 index a5c102e..0000000 --- a/cmd/route-runmigrations/main.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "log" - - "git.xeserv.us/xena/route/internal/database/dmigrations" - "github.com/caarlos0/env" - "github.com/mattes/migrate" - _ "github.com/mattes/migrate/database/postgres" - bindata "github.com/mattes/migrate/source/go-bindata" -) - -type config struct { - DatabaseURL string `env:"DATABASE_URL,required"` -} - -func main() { - var cfg config - err := env.Parse(&cfg) - if err != nil { - log.Fatal(err) - } - - s := bindata.Resource(dmigrations.AssetNames(), - func(name string) ([]byte, error) { - return dmigrations.Asset(name) - }) - - d, err := bindata.WithInstance(s) - if err != nil { - log.Fatal(err) - } - - m, err := migrate.NewWithSourceInstance("go-bindata", d, cfg.DatabaseURL) - if err != nil { - log.Fatal(err) - } - - err = m.Up() - if err != nil { - log.Fatal(err) - } -}