1.0
This commit is contained in:
@@ -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{}, // 配置变更记录表
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user