diff --git a/product/controller.go b/product/controller.go index cdf58df..0dfcc4d 100644 --- a/product/controller.go +++ b/product/controller.go @@ -29,6 +29,11 @@ func NewController(client *coach_client.Client, db *gorm.DB) *Controller { return ctl } +func (c *Controller) AutoMigrate() { + if err := c.db.AutoMigrate(&database.Product{}, &database.HistoryPrice{}, &Option{}); err != nil { + panic(err) + } +} func (c *Controller) Run(ctx context.Context) { c.ctx = ctx ticker := time.NewTicker(c.Interval)