gitea源码

123456789101112131415161718192021222324
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_12
  4. import (
  5. "xorm.io/xorm"
  6. )
  7. func AddUserRepoMissingColumns(x *xorm.Engine) error {
  8. type VisibleType int
  9. type User struct {
  10. PasswdHashAlgo string `xorm:"NOT NULL DEFAULT 'pbkdf2'"`
  11. Visibility VisibleType `xorm:"NOT NULL DEFAULT 0"`
  12. }
  13. type Repository struct {
  14. IsArchived bool `xorm:"INDEX"`
  15. Topics []string `xorm:"TEXT JSON"`
  16. }
  17. return x.Sync(new(User), new(Repository))
  18. }