feat :参数配置中添加是否前台控制

This commit is contained in:
wenjianzhang
2021-03-17 11:16:53 +08:00
parent 2134d9fa58
commit 6746dbd9cf
4 changed files with 41 additions and 5 deletions
@@ -0,0 +1,28 @@
package version
import (
"gorm.io/gorm"
"runtime"
"go-admin/cmd/migrate/migration"
common "go-admin/common/models"
)
func init() {
_, fileName, _, _ := runtime.Caller(0)
migration.Migrate.SetVersion(migration.GetFilename(fileName), _1615948084336Test)
}
func _1615948084336Test(db *gorm.DB, version string) error {
return db.Transaction(func(tx *gorm.DB) error {
err := tx.Exec("alter table sys_config add is_frontend int default 1 null comment '是否前台参数' after config_type").Error
if err != nil {
return err
}
return tx.Create(&common.Migration{
Version: version,
}).Error
})
}