mirror of
https://github.com/status-im/fathom.git
synced 2025-02-28 19:10:36 +00:00
get rid of output when no database migrations ran
This commit is contained in:
parent
ffe1db7c44
commit
ed34f069d5
@ -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) {
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user