@@ -83,43 +83,43 @@ var CmdMigrateStorage = cli.Command{
83
83
}
84
84
85
85
func migrateAttachments (ctx context.Context , dstStorage storage.ObjectStorage ) error {
86
- return db .IterateObjects (ctx , func (attach * repo_model.Attachment ) error {
86
+ return db .Iterate (ctx , nil , func (ctx context. Context , attach * repo_model.Attachment ) error {
87
87
_ , err := storage .Copy (dstStorage , attach .RelativePath (), storage .Attachments , attach .RelativePath ())
88
88
return err
89
89
})
90
90
}
91
91
92
92
func migrateLFS (ctx context.Context , dstStorage storage.ObjectStorage ) error {
93
- return db .IterateObjects (ctx , func (mo * git_model.LFSMetaObject ) error {
93
+ return db .Iterate (ctx , nil , func (ctx context. Context , mo * git_model.LFSMetaObject ) error {
94
94
_ , err := storage .Copy (dstStorage , mo .RelativePath (), storage .LFS , mo .RelativePath ())
95
95
return err
96
96
})
97
97
}
98
98
99
99
func migrateAvatars (ctx context.Context , dstStorage storage.ObjectStorage ) error {
100
- return db .IterateObjects (ctx , func (user * user_model.User ) error {
100
+ return db .Iterate (ctx , nil , func (ctx context. Context , user * user_model.User ) error {
101
101
_ , err := storage .Copy (dstStorage , user .CustomAvatarRelativePath (), storage .Avatars , user .CustomAvatarRelativePath ())
102
102
return err
103
103
})
104
104
}
105
105
106
106
func migrateRepoAvatars (ctx context.Context , dstStorage storage.ObjectStorage ) error {
107
- return db .IterateObjects (ctx , func (repo * repo_model.Repository ) error {
107
+ return db .Iterate (ctx , nil , func (ctx context. Context , repo * repo_model.Repository ) error {
108
108
_ , err := storage .Copy (dstStorage , repo .CustomAvatarRelativePath (), storage .RepoAvatars , repo .CustomAvatarRelativePath ())
109
109
return err
110
110
})
111
111
}
112
112
113
113
func migrateRepoArchivers (ctx context.Context , dstStorage storage.ObjectStorage ) error {
114
- return db .IterateObjects (ctx , func (archiver * repo_model.RepoArchiver ) error {
114
+ return db .Iterate (ctx , nil , func (ctx context. Context , archiver * repo_model.RepoArchiver ) error {
115
115
p := archiver .RelativePath ()
116
116
_ , err := storage .Copy (dstStorage , p , storage .RepoArchives , p )
117
117
return err
118
118
})
119
119
}
120
120
121
121
func migratePackages (ctx context.Context , dstStorage storage.ObjectStorage ) error {
122
- return db .IterateObjects (ctx , func (pb * packages_model.PackageBlob ) error {
122
+ return db .Iterate (ctx , nil , func (ctx context. Context , pb * packages_model.PackageBlob ) error {
123
123
p := packages_module .KeyToRelativePath (packages_module .BlobHash256Key (pb .HashSHA256 ))
124
124
_ , err := storage .Copy (dstStorage , p , storage .Packages , p )
125
125
return err
0 commit comments