feat provider添加AutoMigrate
This commit is contained in:
parent
db0310a6a0
commit
742fc5250a
@ -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{})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user