get rid of output when no database migrations ran

This commit is contained in:
Danny van Kooten 2017-01-25 16:19:07 +01:00
parent ffe1db7c44
commit ed34f069d5
2 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,7 @@ type login struct {
Password string `json:"password"`
}
var store = sessions.NewFilesystemStore("./storage/sessions/", []byte(os.Getenv("ANA_SECRET_KEY")))
var store = sessions.NewCookieStore([]byte(os.Getenv("ANA_SECRET_KEY")))
// URL: POST /api/session
var LoginHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

View File

@ -68,9 +68,12 @@ func runMigrations(driver string) {
migrate.SetTable("migrations")
n, err := migrate.Exec(DB, driver, migrations, migrate.Up)
if err != nil {
log.Fatal("Database migrations failed: ", err)
}
if n > 0 {
log.Printf("Applied %d database migrations!\n", n)
}
}