mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-11-03 16:01:11 +00:00 
			
		
		
		
	Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8422 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			736 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
	
		
			736 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2022 The Gitea Authors. All rights reserved.
 | 
						|
// SPDX-License-Identifier: MIT
 | 
						|
 | 
						|
package v1_17
 | 
						|
 | 
						|
import (
 | 
						|
	"time"
 | 
						|
 | 
						|
	"forgejo.org/models/repo"
 | 
						|
	"forgejo.org/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.Sync(new(PushMirror))
 | 
						|
}
 |