feat provider添加AutoMigrate

This commit is contained in:
timerzz 2024-08-26 17:09:29 +08:00
parent db0310a6a0
commit 742fc5250a

View File

@ -17,6 +17,7 @@ type ProviderApi interface {
Create(provider v2.Provider) error
Update(provider v2.Provider) error
Delete(id uint) (provider v2.Provider, err error)
AutoMigrate() error
}
func NewProviderApi(db *gorm.DB) ProviderApi {
@ -100,3 +101,7 @@ func (p *providerApi) Delete(id uint) (provider v2.Provider, err error) {
})
return
}
func (p *providerApi) AutoMigrate() error {
return p.db.AutoMigrate(&v2.Provider{}, &v2.CalculateProcess{})
}