api: rename performMigrations to migrate
This commit is contained in:
parent
58c011030e
commit
44b7abbe5f
@ -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)
|
@ -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())
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user