diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-19 21:39:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 21:39:57 +0800 |
commit | fc3d0826096943b979717ed46c9a4cfd86e06106 (patch) | |
tree | 3143882ccf4dea3a8bf2a0de9c8da9a4efec26ce /modules/doctor | |
parent | 7a0347315995b25bcb2dca4786504fb699b5f004 (diff) | |
download | gitea-fc3d0826096943b979717ed46c9a4cfd86e06106.tar.gz gitea-fc3d0826096943b979717ed46c9a4cfd86e06106.zip |
Move attachment into models/repo/ (#17650)
* Move attachment into models/repo/
* Fix test
* Fix bug
Diffstat (limited to 'modules/doctor')
-rw-r--r-- | modules/doctor/dbconsistency.go | 5 | ||||
-rw-r--r-- | modules/doctor/storage.go | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/modules/doctor/dbconsistency.go b/modules/doctor/dbconsistency.go index 040f73abcd..e5f0c5678d 100644 --- a/modules/doctor/dbconsistency.go +++ b/modules/doctor/dbconsistency.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/migrations" + repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" ) @@ -110,8 +111,8 @@ func checkDBConsistency(logger log.Logger, autofix bool) error { // find attachments without existing issues or releases { Name: "Orphaned Attachments without existing issues or releases", - Counter: models.CountOrphanedAttachments, - Fixer: asFixer(models.DeleteOrphanedAttachments), + Counter: repo_model.CountOrphanedAttachments, + Fixer: asFixer(repo_model.DeleteOrphanedAttachments), }, // find null archived repositories { diff --git a/modules/doctor/storage.go b/modules/doctor/storage.go index cb06d66204..d2b7f5ee13 100644 --- a/modules/doctor/storage.go +++ b/modules/doctor/storage.go @@ -5,7 +5,7 @@ package doctor import ( - "code.gitea.io/gitea/models" + repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/storage" ) @@ -21,7 +21,7 @@ func checkAttachmentStorageFiles(logger log.Logger, autofix bool) error { if err != nil { return err } - exist, err := models.ExistAttachmentsByUUID(stat.Name()) + exist, err := repo_model.ExistAttachmentsByUUID(stat.Name()) if err != nil { return err } |