Don't use App.Db directly

This commit is contained in:
Abhishek Shroff
2024-07-31 21:05:56 -07:00
parent 45d23dfe47
commit 58b52feefa
5 changed files with 5 additions and 1 deletions

View File

@@ -31,3 +31,7 @@ func (a App) Cleanup() {
a.Db.Close()
}
}
func (a App) MigrateDb(version int) error {
return a.Db.Migrate(version)
}

View File

@@ -29,7 +29,7 @@ func setupSchemaMigrateCommand() *cobra.Command {
if err != nil {
logrus.Fatal(err)
}
if err = app.Default.Db.Migrate(v); err != nil {
if err = app.Default.MigrateDb(v); err != nil {
logrus.Fatal(err)
}
},