File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments