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.

22 lines
428 B
Go

package initialize
import (
"Lee-WineList/client"
"Lee-WineList/model/entity"
"git.echol.cn/loser/logger/log"
)
// 初始化数据库表
func databaseTable() {
dbs := []any{
entity.User{},
entity.AdminUser{},
entity.OAuth2Client{},
}
if err := client.MySQL.AutoMigrate(dbs...); err != nil {
log.Panicf("数据库表预初始化处理:%s", err.Error())
}
log.Debugf("数据库表预初始化处理完成")
}