forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backport migration part of go-gitea#19411 only
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2022 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package migrations | ||
|
||
import ( | ||
"time" | ||
|
||
"code.gitea.io/gitea/models/repo" | ||
"code.gitea.io/gitea/modules/timeutil" | ||
|
||
"xorm.io/xorm" | ||
) | ||
|
||
func addSyncOnCommitColForPushMirror(x *xorm.Engine) error { | ||
type PushMirror struct { | ||
ID int64 `xorm:"pk autoincr"` | ||
RepoID int64 `xorm:"INDEX"` | ||
Repo *repo.Repository `xorm:"-"` | ||
RemoteName string | ||
|
||
SyncOnCommit bool `xorm:"NOT NULL DEFAULT true"` | ||
Interval time.Duration | ||
CreatedUnix timeutil.TimeStamp `xorm:"created"` | ||
LastUpdateUnix timeutil.TimeStamp `xorm:"INDEX last_update"` | ||
LastError string `xorm:"text"` | ||
} | ||
|
||
return x.Sync2(new(PushMirror)) | ||
} |