This commit is contained in:
Wyle.Gong-巩文昕
2025-04-22 16:42:48 +08:00
commit 67b0ad2723
95 changed files with 10508 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package main
import (
"app/cfg"
"app/models"
"app/models/project"
"app/models/project/stage"
"app/models/project/stage/tools"
)
// Run executes all pending migrations
func main() {
// 初始化数据库连接
var db = cfg.DB()
// 在这里添加所有的迁移
migrations := []interface{}{
models.Stage{},
models.GraphLink{},
models.GraphNode{},
models.Tree{},
models.Endpoint{},
models.Doc{},
models.Project{},
models.Response{},
models.Demand{},
project.Demand{},
project.Stage{},
stage.GraphLink{},
stage.GraphNode{},
tools.Endpoint{},
}
// 执行迁移
var _ = db.AutoMigrate(migrations...)
}