Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

v31.go 952B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package migrations
  5. import (
  6. "fmt"
  7. "time"
  8. "github.com/go-xorm/core"
  9. "github.com/go-xorm/xorm"
  10. )
  11. func addLoginSourceSyncEnabledColumn(x *xorm.Engine) error {
  12. // LoginSource see models/login_source.go
  13. type LoginSource struct {
  14. ID int64 `xorm:"pk autoincr"`
  15. Type int
  16. Name string `xorm:"UNIQUE"`
  17. IsActived bool `xorm:"INDEX NOT NULL DEFAULT false"`
  18. IsSyncEnabled bool `xorm:"INDEX NOT NULL DEFAULT false"`
  19. Cfg core.Conversion `xorm:"TEXT"`
  20. Created time.Time `xorm:"-"`
  21. CreatedUnix int64 `xorm:"INDEX"`
  22. Updated time.Time `xorm:"-"`
  23. UpdatedUnix int64 `xorm:"INDEX"`
  24. }
  25. if err := x.Sync2(new(LoginSource)); err != nil {
  26. return fmt.Errorf("Sync2: %v", err)
  27. }
  28. return nil
  29. }