migrate.go
745 字节
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{},
}
db.AutoMigrate(modelsList...)
}