api: rename performMigrations to migrate
This commit is contained in:
parent
58c011030e
commit
44b7abbe5f
@ -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)
|
@ -4,7 +4,7 @@ func main() {
|
||||
exitIfError(loggerCreate())
|
||||
exitIfError(configParse())
|
||||
exitIfError(dbConnect(5))
|
||||
exitIfError(performMigrations())
|
||||
exitIfError(migrate())
|
||||
exitIfError(smtpConfigure())
|
||||
exitIfError(smtpTemplatesLoad())
|
||||
exitIfError(oauthConfigure())
|
||||
|
@ -76,7 +76,7 @@ func setupTestDatabase() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := performMigrationsFromDir("../db/"); err != nil {
|
||||
if err := migrateFromDir("../db/"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user