mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-08 22:46:51 +08:00
fix: Fix file existence check when deleting node upgrade records (#9365)
This commit is contained in:
parent
2fa4f68b1e
commit
e9192e75ea
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue