You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
735 B
42 lines
735 B
package model
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// AutoMigrate 自动迁移所有模型
|
|
func AutoMigrate(db *gorm.DB) error {
|
|
return db.AutoMigrate(
|
|
// 用户相关
|
|
&User{},
|
|
&HealthProfile{},
|
|
&LifestyleInfo{},
|
|
// 健康记录
|
|
&MedicalHistory{},
|
|
&FamilyHistory{},
|
|
&AllergyRecord{},
|
|
// 体质辨识
|
|
&ConstitutionAssessment{},
|
|
&AssessmentAnswer{},
|
|
&QuestionBank{},
|
|
// 对话
|
|
&Conversation{},
|
|
&Message{},
|
|
// 商品(健康推荐 + 商城)
|
|
&Product{},
|
|
&ProductCategory{},
|
|
&ProductSku{},
|
|
&ConstitutionProduct{},
|
|
&SymptomProduct{},
|
|
&PurchaseHistory{},
|
|
// 会员与积分
|
|
&PointsRecord{},
|
|
// 购物车
|
|
&CartItem{},
|
|
// 收货地址
|
|
&Address{},
|
|
// 订单
|
|
&Order{},
|
|
&OrderItem{},
|
|
)
|
|
}
|
|
|