api: rename performMigrations to migrate

This commit is contained in:
Adhityaa Chandrasekar 2018-07-24 12:21:59 +05:30
parent 58c011030e
commit 44b7abbe5f
3 changed files with 5 additions and 5 deletions

View File

@ -6,11 +6,11 @@ import (
"strings" "strings"
) )
func performMigrations() error { func migrate() error {
return performMigrationsFromDir(os.Getenv("STATIC") + "/db") return migrateFromDir(os.Getenv("STATIC") + "/db")
} }
func performMigrationsFromDir(dir string) error { func migrateFromDir(dir string) error {
files, err := ioutil.ReadDir(dir) files, err := ioutil.ReadDir(dir)
if err != nil { if err != nil {
logger.Errorf("cannot read directory for migrations: %v", err) logger.Errorf("cannot read directory for migrations: %v", err)

View File

@ -4,7 +4,7 @@ func main() {
exitIfError(loggerCreate()) exitIfError(loggerCreate())
exitIfError(configParse()) exitIfError(configParse())
exitIfError(dbConnect(5)) exitIfError(dbConnect(5))
exitIfError(performMigrations()) exitIfError(migrate())
exitIfError(smtpConfigure()) exitIfError(smtpConfigure())
exitIfError(smtpTemplatesLoad()) exitIfError(smtpTemplatesLoad())
exitIfError(oauthConfigure()) exitIfError(oauthConfigure())

View File

@ -76,7 +76,7 @@ func setupTestDatabase() error {
return err return err
} }
if err := performMigrationsFromDir("../db/"); err != nil { if err := migrateFromDir("../db/"); err != nil {
return err return err
} }