This commit is contained in:
@@ -2,6 +2,7 @@ package admin
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/config/model"
|
||||
"blazing/modules/config/service"
|
||||
)
|
||||
|
||||
@@ -10,6 +11,15 @@ type SptController struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
// 仅为新加的 SPT 表做定点迁移,避免首次启用 EPS 时读取表结构报错。
|
||||
db, err := cool.InitDB("default")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err = db.AutoMigrate(model.NewSptConfig()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
cool.RegisterController(&SptController{
|
||||
&cool.Controller{
|
||||
Prefix: "/admin/config/spt",
|
||||
|
||||
Reference in New Issue
Block a user