Accept Apper in writefreely.Migrate()

instead of *App
pull/137/head
Matt Baer 5 years ago
parent 3faa2def08
commit 79cf6ce0eb
  1. 10
      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)
}

Loading…
Cancel
Save