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

v17.go 692B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2016 Gitea. 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/xorm"
  9. )
  10. func setProtectedBranchUpdatedWithCreated(x *xorm.Engine) (err error) {
  11. type ProtectedBranch struct {
  12. ID int64 `xorm:"pk autoincr"`
  13. RepoID int64 `xorm:"UNIQUE(s)"`
  14. BranchName string `xorm:"UNIQUE(s)"`
  15. CanPush bool
  16. Created time.Time `xorm:"-"`
  17. CreatedUnix int64
  18. Updated time.Time `xorm:"-"`
  19. UpdatedUnix int64
  20. }
  21. if err = x.Sync2(new(ProtectedBranch)); err != nil {
  22. return fmt.Errorf("Sync2: %v", err)
  23. }
  24. return nil
  25. }