migrate.go
962 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package db
import (
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/models"
"gorm.io/gorm"
)
func Migrate(db *gorm.DB) {
modelsList := []interface{}{
//&models.Article{},
//&models.ArticleSection{},
//&models.ArticleBackup{},
//&models.ArticleDraft{},
//&models.ArticleComment{},
//&models.ArticleTag{},
//&models.UserLoveFlag{},
//&models.UserReadArticle{},
//&models.User{},
//&models.UserRole{},
//&models.Role{},
//&models.Company{},
//&models.UserFollow{},
//&models.MessageSystem{},
//&models.MessageBusiness{},
//&models.Department{},
//&models.ArticleAndTag{},
//&models.ArticleDraftOperation{},
//&models.ArticleCategory{},
//&models.UserSubscribe{},
//&models.MessageSubscribe{},
//&models.UserWechat{},
//&models.ArticleDraftOperation{},
//&models.ArticleCategory{},
&models.ArticleSecurity{},
&models.ArticleTemplate{},
}
db.AutoMigrate(modelsList...)
}