🐛 fix: fix some issues (#77)

* 🐛 fix: Incorrect word spelling

* ♻️ refactor: split function

* 🐛 fix: Delete the disabled channels without deleting the abilities table
This commit is contained in:
Buer
2024-02-29 11:26:02 +08:00
committed by GitHub
parent 1ae0baa8cb
commit fab465e82a
6 changed files with 90 additions and 114 deletions

View File

@@ -262,6 +262,8 @@ func DeleteChannelByStatus(status int64) (int64, error) {
func DeleteDisabledChannel() (int64, error) {
result := DB.Where("status = ? or status = ?", common.ChannelStatusAutoDisabled, common.ChannelStatusManuallyDisabled).Delete(&Channel{})
// 同时删除Ability
DB.Where("enabled = ?", false).Delete(&Ability{})
return result.RowsAffected, result.Error
}