You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

v215.go 820B

123456789101112131415161718192021222324
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_17 //nolint
  4. import (
  5. "code.gitea.io/gitea/models/pull"
  6. "code.gitea.io/gitea/modules/timeutil"
  7. "xorm.io/xorm"
  8. )
  9. func AddReviewViewedFiles(x *xorm.Engine) error {
  10. type ReviewState struct {
  11. ID int64 `xorm:"pk autoincr"`
  12. UserID int64 `xorm:"NOT NULL UNIQUE(pull_commit_user)"`
  13. PullID int64 `xorm:"NOT NULL INDEX UNIQUE(pull_commit_user) DEFAULT 0"`
  14. CommitSHA string `xorm:"NOT NULL VARCHAR(40) UNIQUE(pull_commit_user)"`
  15. UpdatedFiles map[string]pull.ViewedState `xorm:"NOT NULL LONGTEXT JSON"`
  16. UpdatedUnix timeutil.TimeStamp `xorm:"updated"`
  17. }
  18. return x.Sync(new(ReviewState))
  19. }