This commit is contained in:
solosw
2026-01-05 14:11:34 +08:00
parent 35ef825371
commit 99b11b04e4
658 changed files with 99266 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package models
import (
"awesomeProject/internal/common"
"awesomeProject/internal/config"
)
// AutoMigrateAll 自动迁移所有数据表
func AutoMigrateAll() error {
db := common.GetDB()
// 按依赖关系迁移表
return db.AutoMigrate(
&User{},
&UserAddress{},
&ProductCategory{},
&PrimaryProduct{},
&SecondaryProduct{},
&UserWarehouse{},
&PurchaseOrder{},
&SalesOrder{},
&OrderMessage{}, // 订单留言表
&SystemConfig{},
&ScoreRecord{},
&Banner{}, // 轮播图表
&config.ConfigChange{}, // 配置变更记录表
)
}