mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-20 12:27:18 +08:00
fix: Modify default values for recommended apps on dashboard (#9375)
This commit is contained in:
parent
1767b84026
commit
afa643519f
2 changed files with 17 additions and 0 deletions
|
@ -28,6 +28,7 @@ func InitAgentDB() {
|
|||
migrations.AddSnapshotRule,
|
||||
migrations.UpdatePHPRuntime,
|
||||
migrations.AddSnapshotIgnore,
|
||||
migrations.InitAppLauncher,
|
||||
})
|
||||
if err := m.Migrate(); err != nil {
|
||||
global.LOG.Error(err)
|
||||
|
|
|
@ -344,3 +344,19 @@ var AddSnapshotIgnore = &gormigrate.Migration{
|
|||
)
|
||||
},
|
||||
}
|
||||
|
||||
var InitAppLauncher = &gormigrate.Migration{
|
||||
ID: "20250702-init-app-launcher",
|
||||
Migrate: func(tx *gorm.DB) error {
|
||||
launchers := []string{"openresty", "mysql", "halo", "redis", "maxkb", "wordpress"}
|
||||
for _, val := range launchers {
|
||||
var item model.AppLauncher
|
||||
_ = tx.Model(&model.AppLauncher{}).Where("key = ?", val).First(&item).Error
|
||||
if item.ID == 0 {
|
||||
item.Key = val
|
||||
_ = tx.Create(&item).Error
|
||||
}
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue