removed migrate function in app struct
This commit is contained in:
parent
a39a9a007c
commit
e6230838c1
17
app/app.go
17
app/app.go
@ -40,20 +40,3 @@ func (a *App) Start() {
|
||||
listenAddr := fmt.Sprintf("%s:%s", os.Getenv("APP_HOST"), os.Getenv("APP_PORT"))
|
||||
log.Fatal(a.d.Start(listenAddr))
|
||||
}
|
||||
|
||||
func (a *App) Migrate(dst ...any) error {
|
||||
if len(dst) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
db, err := a.d.DB()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := db.Conn.AutoMigrate(dst); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user