2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: 从数据库读取备份记录

This commit is contained in:
2026-01-19 23:50:04 +08:00
parent 046105a542
commit 5c6892c7f5
3 changed files with 22 additions and 3 deletions

View File

@@ -59,4 +59,19 @@ func init() {
return tx.Migrator().DropTable(&biz.Project{})
},
})
Migrations = append(Migrations, &gormigrate.Migration{
ID: "20260120-add-backup",
Migrate: func(tx *gorm.DB) error {
return tx.AutoMigrate(
&biz.Backup{},
&biz.BackupAccount{},
)
},
Rollback: func(tx *gorm.DB) error {
return tx.Migrator().DropTable(
&biz.Backup{},
&biz.BackupAccount{},
)
},
})
}