Skip to content

Commit 72170c8

Browse files
committed
backport migration part of go-gitea#19411 only
1 parent c8e93b2 commit 72170c8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

models/migrations/v219.go

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
}

0 commit comments

Comments
 (0)