From 79cf6ce0eb9d194abb038d2238c8d66f57dd2f26 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 3 Jul 2019 14:39:05 -0400 Subject: [PATCH] Accept Apper in writefreely.Migrate() instead of *App --- app.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app.go b/app.go index 5ff6ebd..4155874 100644 --- a/app.go +++ b/app.go @@ -564,12 +564,12 @@ func CreateSchema(apper Apper) error { } // Migrate runs all necessary database migrations. -func Migrate(app *App) error { - app.LoadConfig() - connectToDatabase(app) - defer shutdown(app) +func Migrate(apper Apper) error { + apper.LoadConfig() + connectToDatabase(apper.App()) + defer shutdown(apper.App()) - err := migrations.Migrate(migrations.NewDatastore(app.db.DB, app.db.driverName)) + err := migrations.Migrate(migrations.NewDatastore(apper.App().db.DB, apper.App().db.driverName)) if err != nil { return fmt.Errorf("migrate: %s", err) }