everywhere: add email notifications

This commit is contained in:
Adhityaa Chandrasekar
2019-02-18 11:23:44 -05:00
parent 69aba94590
commit 06f0f6f014
33 changed files with 872 additions and 30 deletions

View File

@@ -6,6 +6,10 @@ import (
"strings"
)
var goMigrations = map[string](func() error){
"20190213033530-email-notifications.sql": migrateEmails,
}
func migrate() error {
return migrateFromDir(os.Getenv("STATIC") + "/db")
}
@@ -69,6 +73,13 @@ func migrateFromDir(dir string) error {
return err
}
if fn, ok := goMigrations[file.Name()]; ok {
if err = fn(); err != nil {
logger.Errorf("cannot execute Go migration associated with SQL %s: %v", f, err)
return err
}
}
completed++
}
}