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 }