From 44b7abbe5f8f4ab06af5c3a7e43da269b6478158 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Tue, 24 Jul 2018 12:21:59 +0530 Subject: [PATCH] api: rename performMigrations to migrate --- api/{database_migrations.go => database_migrate.go} | 6 +++--- api/main.go | 2 +- api/testing.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename api/{database_migrations.go => database_migrate.go} (91%) diff --git a/api/database_migrations.go b/api/database_migrate.go similarity index 91% rename from api/database_migrations.go rename to api/database_migrate.go index f625203..d777c55 100644 --- a/api/database_migrations.go +++ b/api/database_migrate.go @@ -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) diff --git a/api/main.go b/api/main.go index 8394b8b..59c814a 100644 --- a/api/main.go +++ b/api/main.go @@ -4,7 +4,7 @@ func main() { exitIfError(loggerCreate()) exitIfError(configParse()) exitIfError(dbConnect(5)) - exitIfError(performMigrations()) + exitIfError(migrate()) exitIfError(smtpConfigure()) exitIfError(smtpTemplatesLoad()) exitIfError(oauthConfigure()) diff --git a/api/testing.go b/api/testing.go index 7ca3d95..6dc94a3 100644 --- a/api/testing.go +++ b/api/testing.go @@ -76,7 +76,7 @@ func setupTestDatabase() error { return err } - if err := performMigrationsFromDir("../db/"); err != nil { + if err := migrateFromDir("../db/"); err != nil { return err }