Skip to content

Commit 5be1bde

Browse files
committed
Merge branch 'master' into git_simple_pr
2 parents 434704c + a3cc842 commit 5be1bde

File tree

6 files changed

+33
-9
lines changed

6 files changed

+33
-9
lines changed

models/migrations/migrations.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ var migrations = []Migration{
289289
// v170 -> v171
290290
NewMigration("Add Dismissed to Review table", addDismissedReviewColumn),
291291
// v171 -> v172
292+
NewMigration("Add Sorting to ProjectBoard table", addSortingColToProjectBoard),
293+
// v172 -> v173
292294
NewMigration("Add agit style pull request support", addAgitStylePullRequest),
293295
}
294296

models/migrations/v171.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ import (
1010
"xorm.io/xorm"
1111
)
1212

13-
func addAgitStylePullRequest(x *xorm.Engine) error {
14-
type PullRequestStyle int
15-
16-
type PullRequest struct {
17-
Style PullRequestStyle
13+
func addSortingColToProjectBoard(x *xorm.Engine) error {
14+
type ProjectBoard struct {
15+
Sorting int8 `xorm:"NOT NULL DEFAULT 0"`
1816
}
1917

20-
if err := x.Sync2(new(PullRequest)); err != nil {
18+
if err := x.Sync2(new(ProjectBoard)); err != nil {
2119
return fmt.Errorf("Sync2: %v", err)
2220
}
2321
return nil

models/migrations/v172.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2021 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+
"fmt"
9+
10+
"xorm.io/xorm"
11+
)
12+
13+
func addAgitStylePullRequest(x *xorm.Engine) error {
14+
type PullRequestStyle int
15+
16+
type PullRequest struct {
17+
Style PullRequestStyle
18+
}
19+
20+
if err := x.Sync2(new(PullRequest)); err != nil {
21+
return fmt.Errorf("Sync2: %v", err)
22+
}
23+
return nil
24+
}

models/project_board.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type ProjectBoard struct {
3636
ID int64 `xorm:"pk autoincr"`
3737
Title string
3838
Default bool `xorm:"NOT NULL DEFAULT false"` // issues not assigned to a specific board will be assigned to this board
39-
Sorting int8 `xorm:"DEFAULT 0"`
39+
Sorting int8 `xorm:"NOT NULL DEFAULT 0"`
4040

4141
ProjectID int64 `xorm:"INDEX NOT NULL"`
4242
CreatorID int64 `xorm:"NOT NULL"`

routers/api/v1/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
// Schemes: http, https
1111
// BasePath: /api/v1
12-
// Version: 1.1.1
12+
// Version: {{AppVer}}
1313
// License: MIT http://opensource.org/licenses/MIT
1414
//
1515
// Consumes:

templates/swagger/v1_json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"name": "MIT",
2020
"url": "http://opensource.org/licenses/MIT"
2121
},
22-
"version": "1.1.1"
22+
"version": "{{AppVer}}"
2323
},
2424
"basePath": "{{AppSubUrl}}/api/v1",
2525
"paths": {

0 commit comments

Comments
 (0)