mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Delete related PullAutoMerge and ReviewState on User/Repo Deletion (#19649)
* delete pullautomerges on repo/user deletion * delete reviewstates on repo/user deletion * optimize automerhe code * add index to reviewstate
This commit is contained in:
parent
4344a64107
commit
6a969681cd
17 changed files with 124 additions and 95 deletions
|
@ -42,3 +42,18 @@ func IsErrSSHDisabled(err error) bool {
|
|||
func (err ErrSSHDisabled) Error() string {
|
||||
return "SSH is disabled"
|
||||
}
|
||||
|
||||
// ErrNotExist represents a non-exist error.
|
||||
type ErrNotExist struct {
|
||||
ID int64
|
||||
}
|
||||
|
||||
// IsErrNotExist checks if an error is an ErrNotExist
|
||||
func IsErrNotExist(err error) bool {
|
||||
_, ok := err.(ErrNotExist)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrNotExist) Error() string {
|
||||
return fmt.Sprintf("record does not exist [id: %d]", err.ID)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue