Merged in josharian/goose (pull request #1: Autocreate db/migrations)

pull/2/head
Liam Staskawicz 2013-01-09 18:09:48 -08:00
commit 17747efe29
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"fmt"
"log"
"os"
"path"
"path/filepath"
"text/template"
@ -37,6 +38,10 @@ func createRun(cmd *Command, args ...string) {
timestamp := time.Now().Format("20060102150405")
filename := fmt.Sprintf("%v_%v.%v", timestamp, args[0], migrationType)
err = os.MkdirAll(conf.MigrationsDir, 0777)
if err != nil {
log.Fatal(err)
}
fpath := path.Join(conf.MigrationsDir, filename)
var tmpl *template.Template