Sergiusz Bazanski | 30317b4 | 2019-08-01 16:50:41 +0200 | [diff] [blame] | 1 | package migrations |
2 | |||||
3 | import ( | ||||
4 | "fmt" | ||||
5 | |||||
6 | "code.hackerspace.pl/hscloud/go/mirko" | ||||
7 | |||||
8 | "github.com/golang-migrate/migrate/v4" | ||||
9 | ) | ||||
10 | |||||
11 | func New(dburl string) (*migrate.Migrate, error) { | ||||
12 | source, err := mirko.NewMigrationsFromBazel(Data) | ||||
13 | if err != nil { | ||||
14 | return nil, fmt.Errorf("could not create migrations: %v", err) | ||||
15 | } | ||||
16 | return migrate.NewWithSourceInstance("bazel", source, dburl) | ||||
17 | } |