keep all args handling in main.go for now

This commit is contained in:
Liam Staskawicz 2012-12-15 12:10:00 -08:00
parent c8383e8a34
commit 2bc4ab80a0
2 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
runMigrations(conf, *targetVersion) runMigrations(conf, path.Join(*dbFolder, "migrations"), *targetVersion)
} }
// extract configuration details from the given file // extract configuration details from the given file

View File

@ -31,7 +31,7 @@ type MigrationMap struct {
Direction bool // sort direction: true -> Up, false -> Down Direction bool // sort direction: true -> Up, false -> Down
} }
func runMigrations(conf *DBConf, target int) { func runMigrations(conf *DBConf, migrationsDir string, target int) {
db, err := sql.Open(conf.Driver, conf.OpenStr) db, err := sql.Open(conf.Driver, conf.OpenStr)
if err != nil { if err != nil {
@ -44,7 +44,7 @@ func runMigrations(conf *DBConf, target int) {
log.Fatal("couldn't get/set DB version") log.Fatal("couldn't get/set DB version")
} }
mm, err := collectMigrations(path.Join(*dbFolder, "migrations"), current, target) mm, err := collectMigrations(migrationsDir, current, target)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }