fix: Fix file existence check when deleting node upgrade records (#9365)

This commit is contained in:
ssongliu 2025-07-01 22:29:33 +08:00 committed by GitHub
parent 2fa4f68b1e
commit e9192e75ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,6 +16,7 @@ type IUpgradeLogRepo interface {
Delete(opts ...global.DBOption) error
WithByNodeID(nodeID uint) global.DBOption
WithByUpgradeVersion(oldVersion, newVersion string) global.DBOption
}
func NewIUpgradeLogRepo() IUpgradeLogRepo {
@ -79,3 +80,9 @@ func (c *UpgradeLogRepo) WithByNodeID(nodeID uint) global.DBOption {
return g.Where("node_id = ?", nodeID)
}
}
func (c *UpgradeLogRepo) WithByUpgradeVersion(oldVersion, newVersion string) global.DBOption {
return func(g *gorm.DB) *gorm.DB {
return g.Where("old_version = ? AND new_version = ?", oldVersion, newVersion)
}
}