Skip to content

Commit

Permalink
backport migration part of go-gitea#19411 only
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Jul 30, 2022
1 parent c8e93b2 commit 72170c8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions models/migrations/v219.go
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))
}

0 comments on commit 72170c8

Please sign in to comment.