Skip to content

Commit 4adf2e1

Browse files
author
Gusted
committed
Specify Privatekey length in database
- Round to 400, actual length is 387, just to be _sure_.
1 parent dc80fdf commit 4adf2e1

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

models/migrations/v213.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,27 @@ package migrations
66

77
import (
88
"fmt"
9+
"time"
910

11+
"code.gitea.io/gitea/models/repo"
12+
"code.gitea.io/gitea/modules/timeutil"
1013
"xorm.io/xorm"
1114
)
1215

1316
func addKeypairToPushMirror(x *xorm.Engine) error {
1417
type PushMirror struct {
18+
ID int64 `xorm:"pk autoincr"`
19+
RepoID int64 `xorm:"INDEX"`
20+
Repo *repo.Repository `xorm:"-"`
21+
RemoteName string
22+
1523
PublicKey string
16-
PrivateKey string
24+
PrivateKey string `xorm:"VARCHAR(400)"`
25+
26+
Interval time.Duration
27+
CreatedUnix timeutil.TimeStamp `xorm:"created"`
28+
LastUpdateUnix timeutil.TimeStamp `xorm:"INDEX last_update"`
29+
LastError string `xorm:"text"`
1730
}
1831

1932
if err := x.Sync2(new(PushMirror)); err != nil {

models/repo/pushmirror.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type PushMirror struct {
2727

2828
// A keypair formatted in OpenSSH format.
2929
PublicKey string
30-
PrivateKey string
30+
PrivateKey string `xorm:"VARCHAR(400)"`
3131

3232
Interval time.Duration
3333
CreatedUnix timeutil.TimeStamp `xorm:"created"`

0 commit comments

Comments
 (0)