Skip to content

Commit 1a4572a

Browse files
committed
Adjust sequence of functions
1 parent 967f20c commit 1a4572a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

models/repo/update.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ func UpdateRepositoryOwnerNames(ctx context.Context, ownerID int64, ownerName st
3434
return committer.Commit()
3535
}
3636

37-
// UpdateRepositoryColsWithAutoTime updates repository's columns
38-
func UpdateRepositoryColsWithAutoTime(ctx context.Context, repo *Repository, cols ...string) error {
39-
_, err := db.GetEngine(ctx).ID(repo.ID).Cols(cols...).Update(repo)
40-
return err
41-
}
42-
4337
// UpdateRepositoryUpdatedTime updates a repository's updated time
4438
func UpdateRepositoryUpdatedTime(ctx context.Context, repoID int64, updateTime time.Time) error {
4539
_, err := db.GetEngine(ctx).Exec("UPDATE repository SET updated_unix = ? WHERE id = ?", updateTime.Unix(), repoID)
4640
return err
4741
}
4842

43+
// UpdateRepositoryColsWithAutoTime updates repository's columns
44+
func UpdateRepositoryColsWithAutoTime(ctx context.Context, repo *Repository, cols ...string) error {
45+
_, err := db.GetEngine(ctx).ID(repo.ID).Cols(cols...).Update(repo)
46+
return err
47+
}
48+
4949
// UpdateRepositoryColsNoAutoTime updates repository's columns and but applies time change automatically
5050
func UpdateRepositoryColsNoAutoTime(ctx context.Context, repo *Repository, cols ...string) error {
5151
_, err := db.GetEngine(ctx).ID(repo.ID).Cols(cols...).NoAutoTime().Update(repo)

0 commit comments

Comments
 (0)