mirror of
https://github.com/writefreely/writefreely
synced 2024-11-28 11:30:18 +00:00
Accept Apper in writefreely.Migrate()
instead of *App
This commit is contained in:
parent
3faa2def08
commit
79cf6ce0eb
1 changed files with 5 additions and 5 deletions
10
app.go
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…
Reference in a new issue