migrate.go
465 字节
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.UserLoveFlag{},
&models.User{},
&models.Role{},
&models.Company{},
&models.UserFollow{},
}
db.AutoMigrate(modelsList...)
}