✨ init project
This commit is contained in:
21
initialize/gorm_biz.go
Normal file
21
initialize/gorm_biz.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package initialize
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/lckt/global"
|
||||
"git.echol.cn/loser/lckt/model/article"
|
||||
"git.echol.cn/loser/lckt/model/bot"
|
||||
"git.echol.cn/loser/lckt/model/category"
|
||||
)
|
||||
|
||||
func bizModel() error {
|
||||
db := global.GVA_DB
|
||||
err := db.AutoMigrate(
|
||||
category.Category{},
|
||||
bot.Bot{},
|
||||
article.Article{},
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user