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"
)
func performMigrations() error {
return performMigrationsFromDir(os.Getenv("STATIC") + "/db")
func migrate() error {
return migrateFromDir(os.Getenv("STATIC") + "/db")
}
func performMigrationsFromDir(dir string) error {
func migrateFromDir(dir string) error {
files, err := ioutil.ReadDir(dir)
if err != nil {
logger.Errorf("cannot read directory for migrations: %v", err)

View File

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

View File

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