mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 00:00:50 +00:00
feat: add alert database initialization and migration steps (#12925)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
func Init() {
|
||||
InitAgentDB()
|
||||
InitTaskDB()
|
||||
InitAlertDB()
|
||||
global.LOG.Info("Migration run successfully")
|
||||
}
|
||||
|
||||
@@ -36,8 +37,6 @@ func InitAgentDB() {
|
||||
migrations.UpdateMcpServer,
|
||||
migrations.InitCronjobGroup,
|
||||
migrations.AddColumnToAlert,
|
||||
migrations.MigrateAlertMethodConfigIDs,
|
||||
migrations.AddAlertAuditUser,
|
||||
migrations.UpdateWebsiteSSL,
|
||||
migrations.AddQuickJump,
|
||||
migrations.UpdateMcpServerAddType,
|
||||
@@ -103,3 +102,14 @@ func InitTaskDB() {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func InitAlertDB() {
|
||||
m := gormigrate.New(global.AlertDB, gormigrate.DefaultOptions, []*gormigrate.Migration{
|
||||
migrations.MigrateAlertMethodConfigIDs,
|
||||
migrations.AddAlertAuditUser,
|
||||
})
|
||||
if err := m.Migrate(); err != nil {
|
||||
global.LOG.Error(err)
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user