You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
398 B
Go

package initialize
import (
"ginDemo/client"
"ginDemo/model/entity"
"gitee.ltd/lxh/logger"
)
// 初始化数据库表
func databaseTable() {
dbs := []any{
new(entity.User), // 管理员用户
}
if err := client.MySQL.AutoMigrate(dbs...); err != nil {
logger.Say.Panicf("数据库表预初始化处理:%s", err.Error())
}
logger.Say.Debugf("数据库表预初始化处理完成")
}