gitea源码

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_17
  4. import (
  5. "time"
  6. "code.gitea.io/gitea/models/repo"
  7. "code.gitea.io/gitea/modules/timeutil"
  8. "xorm.io/xorm"
  9. )
  10. func AddSyncOnCommitColForPushMirror(x *xorm.Engine) error {
  11. type PushMirror struct {
  12. ID int64 `xorm:"pk autoincr"`
  13. RepoID int64 `xorm:"INDEX"`
  14. Repo *repo.Repository `xorm:"-"`
  15. RemoteName string
  16. SyncOnCommit bool `xorm:"NOT NULL DEFAULT true"`
  17. Interval time.Duration
  18. CreatedUnix timeutil.TimeStamp `xorm:"created"`
  19. LastUpdateUnix timeutil.TimeStamp `xorm:"INDEX last_update"`
  20. LastError string `xorm:"text"`
  21. }
  22. return x.Sync(new(PushMirror))
  23. }