diff --git a/structs/storage/provider-article.go b/structs/storage/provider-article.go index 4b52629..edd065d 100644 --- a/structs/storage/provider-article.go +++ b/structs/storage/provider-article.go @@ -10,6 +10,7 @@ import ( type ProviderArticleApi interface { Get(query GetProviderArticleQuery) (article v2.ProviderArticle, err error) Upsert(article v2.ProviderArticle) error + AutoMigrate() error } type providerArticleApi struct { @@ -58,3 +59,7 @@ func (p *providerArticleApi) Upsert(article v2.ProviderArticle) error { DoUpdates: clause.AssignmentColumns([]string{"cost"}), }).Create(&article).Error } + +func (p *providerArticleApi) AutoMigrate() error { + return p.db.AutoMigrate(&v2.ProviderArticle{}) +} diff --git a/structs/storage/seller-article.go b/structs/storage/seller-article.go index b4ae2cf..aaf542f 100644 --- a/structs/storage/seller-article.go +++ b/structs/storage/seller-article.go @@ -10,6 +10,7 @@ import ( type SellerArticleApi interface { Get(query GetProviderArticleQuery) (article v2.ProviderArticle, err error) Upsert(article v2.SellerArticle) error + AutoMigrate() error } type sellerArticleApi struct { @@ -54,3 +55,7 @@ func (p *sellerArticleApi) Upsert(article v2.SellerArticle) error { DoUpdates: clause.AssignmentColumns([]string{"sell"}), }).Create(&article).Error } + +func (p *sellerArticleApi) AutoMigrate() error { + return p.db.AutoMigrate(&v2.SellerArticle{}) +}