mirror of
https://gitcode.com/flipped-aurora/gin-vue-admin.git
synced 2026-05-14 11:17:55 +00:00
数据初始化完成
This commit is contained in:
@@ -3,12 +3,14 @@ package initialize
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"os"
|
||||
)
|
||||
|
||||
// 注册数据库表专用
|
||||
func DBTables() {
|
||||
db := global.GVA_DB
|
||||
db.AutoMigrate(model.SysUser{},
|
||||
err := db.AutoMigrate(
|
||||
model.SysUser{},
|
||||
model.SysAuthority{},
|
||||
model.SysApi{},
|
||||
model.SysBaseMenu{},
|
||||
@@ -25,5 +27,9 @@ func DBTables() {
|
||||
model.ExaCustomer{},
|
||||
model.SysOperationRecord{},
|
||||
)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("register table failed", err)
|
||||
os.Exit(0)
|
||||
}
|
||||
global.GVA_LOG.Debug("register table success")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user