Skip to content

Commit a5f551e

Browse files
committed
fix merge
1 parent 357a5e5 commit a5f551e

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

models/migrations/migrations.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ var migrations = []Migration{
348348
NewMigration("Add Color to ProjectBoard table", addColorColToProjectBoard),
349349
// v197 -> v198
350350
NewMigration("Add renamed_branch table", addRenamedBranchTable),
351+
// v198 -> v199
351352
NewMigration("Add issue content history table", addTableIssueContentHistory),
352353
}
353354

models/migrations/v198.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
"code.gitea.io/gitea/modules/timeutil"
11+
12+
"xorm.io/xorm"
13+
)
14+
15+
func addTableIssueContentHistory(x *xorm.Engine) error {
16+
type IssueContentHistory struct {
17+
ID int64 `xorm:"pk autoincr"`
18+
PosterID int64
19+
IssueID int64 `xorm:"INDEX"`
20+
CommentID int64 `xorm:"INDEX"`
21+
EditedUnix timeutil.TimeStamp `xorm:"INDEX"`
22+
ContentText string `xorm:"LONGTEXT"`
23+
IsFirstCreated bool
24+
IsDeleted bool
25+
}
26+
27+
sess := x.NewSession()
28+
defer sess.Close()
29+
if err := sess.Sync2(new(IssueContentHistory)); err != nil {
30+
return fmt.Errorf("Sync2: %v", err)
31+
}
32+
return sess.Commit()
33+
}

0 commit comments

Comments
 (0)