File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2022 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
+
5
+ package migrations
6
+
7
+ import (
8
+ "time"
9
+
10
+ "code.gitea.io/gitea/models/repo"
11
+ "code.gitea.io/gitea/modules/timeutil"
12
+
13
+ "xorm.io/xorm"
14
+ )
15
+
16
+ func addSyncOnCommitColForPushMirror (x * xorm.Engine ) error {
17
+ type PushMirror struct {
18
+ ID int64 `xorm:"pk autoincr"`
19
+ RepoID int64 `xorm:"INDEX"`
20
+ Repo * repo.Repository `xorm:"-"`
21
+ RemoteName string
22
+
23
+ SyncOnCommit bool `xorm:"NOT NULL DEFAULT true"`
24
+ Interval time.Duration
25
+ CreatedUnix timeutil.TimeStamp `xorm:"created"`
26
+ LastUpdateUnix timeutil.TimeStamp `xorm:"INDEX last_update"`
27
+ LastError string `xorm:"text"`
28
+ }
29
+
30
+ return x .Sync2 (new (PushMirror ))
31
+ }
You can’t perform that action at this time.
0 commit comments