File tree Expand file tree Collapse file tree 8 files changed +46
-6
lines changed Expand file tree Collapse file tree 8 files changed +46
-6
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ The SQL dump created by `gitea dump` uses XORM and Gitea admins may prefer to us
62
62
# mysql
63
63
mysqldump -u$USER -p$PASS --database $DATABASE > gitea-db.sql
64
64
# postgres
65
- pgdump -U $USER $DATABASE > gitea-db.sql
65
+ pg_dump -U $USER $DATABASE > gitea-db.sql
66
66
```
67
67
68
68
### Using Docker (` dump ` )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ type GPGKey struct {
33
33
OwnerID int64 `xorm:"INDEX NOT NULL"`
34
34
KeyID string `xorm:"INDEX CHAR(16) NOT NULL"`
35
35
PrimaryKeyID string `xorm:"CHAR(16)"`
36
- Content string `xorm:"TEXT NOT NULL"`
36
+ Content string `xorm:"MEDIUMTEXT NOT NULL"`
37
37
CreatedUnix timeutil.TimeStamp `xorm:"created"`
38
38
ExpiredUnix timeutil.TimeStamp
39
39
AddedUnix timeutil.TimeStamp
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ type PublicKey struct {
41
41
OwnerID int64 `xorm:"INDEX NOT NULL"`
42
42
Name string `xorm:"NOT NULL"`
43
43
Fingerprint string `xorm:"INDEX NOT NULL"`
44
- Content string `xorm:"TEXT NOT NULL"`
44
+ Content string `xorm:"MEDIUMTEXT NOT NULL"`
45
45
Mode perm.AccessMode `xorm:"NOT NULL DEFAULT 2"`
46
46
Type KeyType `xorm:"NOT NULL DEFAULT 1"`
47
47
LoginSourceID int64 `xorm:"NOT NULL DEFAULT 0"`
Original file line number Diff line number Diff line change @@ -406,8 +406,13 @@ var migrations = []Migration{
406
406
NewMigration ("Drop old CredentialID column" , dropOldCredentialIDColumn ),
407
407
// v223 -> v224
408
408
NewMigration ("Rename CredentialIDBytes column to CredentialID" , renameCredentialIDBytes ),
409
+
410
+ // Gitea 1.17.0 ends at v224
411
+
409
412
// v224 -> v225
410
- NewMigration ("Add badges to users" , creatUserBadgesTable ),
413
+ NewMigration ("Add badges to users" , createUserBadgesTable ),
414
+ // v225 -> v226
415
+ NewMigration ("Alter gpg_key/public_key content TEXT fields to MEDIUMTEXT" , alterPublicGPGKeyContentFieldsToMediumText ),
411
416
}
412
417
413
418
// GetCurrentDBVersion returns the current db version
Original file line number Diff line number Diff line change 8
8
"xorm.io/xorm"
9
9
)
10
10
11
- func creatUserBadgesTable (x * xorm.Engine ) error {
11
+ func createUserBadgesTable (x * xorm.Engine ) error {
12
12
type Badge struct {
13
13
ID int64 `xorm:"pk autoincr"`
14
14
Description string
Original file line number Diff line number Diff line change
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
+ "code.gitea.io/gitea/modules/setting"
9
+
10
+ "xorm.io/xorm"
11
+ )
12
+
13
+ func alterPublicGPGKeyContentFieldsToMediumText (x * xorm.Engine ) error {
14
+ sess := x .NewSession ()
15
+ defer sess .Close ()
16
+ if err := sess .Begin (); err != nil {
17
+ return err
18
+ }
19
+
20
+ if setting .Database .UseMySQL {
21
+ if _ , err := sess .Exec ("ALTER TABLE `gpg_key` CHANGE `content` `content` MEDIUMTEXT" ); err != nil {
22
+ return err
23
+ }
24
+ if _ , err := sess .Exec ("ALTER TABLE `public_key` CHANGE `content` `content` MEDIUMTEXT" ); err != nil {
25
+ return err
26
+ }
27
+ }
28
+ return sess .Commit ()
29
+ }
Original file line number Diff line number Diff line change @@ -301,6 +301,7 @@ func Pulls(ctx *context.Context) {
301
301
302
302
ctx .Data ["Title" ] = ctx .Tr ("pull_requests" )
303
303
ctx .Data ["PageIsPulls" ] = true
304
+ ctx .Data ["SingleRepoAction" ] = "pull"
304
305
buildIssueOverview (ctx , unit .TypePullRequests )
305
306
}
306
307
@@ -314,6 +315,7 @@ func Issues(ctx *context.Context) {
314
315
315
316
ctx .Data ["Title" ] = ctx .Tr ("issues" )
316
317
ctx .Data ["PageIsIssues" ] = true
318
+ ctx .Data ["SingleRepoAction" ] = "issue"
317
319
buildIssueOverview (ctx , unit .TypeIssues )
318
320
}
319
321
Original file line number Diff line number Diff line change 100
100
</div>
101
101
</div>
102
102
{{if .SingleRepoLink}}
103
- <a class="ui green button" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
103
+ {{if eq .SingleRepoAction "issue"}}
104
+ <a class="ui green button" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
105
+ {{else if eq .SingleRepoAction "pull"}}
106
+ <a class="ui green button" href="{{.SingleRepoLink}}/compare">{{.locale.Tr "repo.pulls.new"}}</a>
107
+ {{end}}
104
108
{{end}}
105
109
</div>
106
110
</div>
You can’t perform that action at this time.
0 commit comments