Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Oct 8, 2021
1 parent 357a5e5 commit a5f551e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions models/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ var migrations = []Migration{
NewMigration("Add Color to ProjectBoard table", addColorColToProjectBoard),
// v197 -> v198
NewMigration("Add renamed_branch table", addRenamedBranchTable),
// v198 -> v199
NewMigration("Add issue content history table", addTableIssueContentHistory),
}

Expand Down
33 changes: 33 additions & 0 deletions models/migrations/v198.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package migrations

import (
"fmt"

"code.gitea.io/gitea/modules/timeutil"

"xorm.io/xorm"
)

func addTableIssueContentHistory(x *xorm.Engine) error {
type IssueContentHistory struct {
ID int64 `xorm:"pk autoincr"`
PosterID int64
IssueID int64 `xorm:"INDEX"`
CommentID int64 `xorm:"INDEX"`
EditedUnix timeutil.TimeStamp `xorm:"INDEX"`
ContentText string `xorm:"LONGTEXT"`
IsFirstCreated bool
IsDeleted bool
}

sess := x.NewSession()
defer sess.Close()
if err := sess.Sync2(new(IssueContentHistory)); err != nil {
return fmt.Errorf("Sync2: %v", err)
}
return sess.Commit()
}

0 comments on commit a5f551e

Please sign in to comment.