From 7723e15e64a59238b1093a08e8ed63e9882159b5 Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Sun, 13 May 2018 22:15:16 +0200 Subject: [PATCH] Moved review migration from v64 to v65 Signed-off-by: Jonas Franz --- models/migrations/v65.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 models/migrations/v65.go diff --git a/models/migrations/v65.go b/models/migrations/v65.go new file mode 100644 index 0000000000..4924b41ceb --- /dev/null +++ b/models/migrations/v65.go @@ -0,0 +1,31 @@ +// Copyright 2018 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/util" + + "github.com/go-xorm/xorm" +) + +func addReview(x *xorm.Engine) error { + // Review see models/review.go + type Review struct { + ID int64 `xorm:"pk autoincr"` + Type string + ReviewerID int64 `xorm:"index"` + IssueID int64 `xorm:"index"` + Content string + CreatedUnix util.TimeStamp `xorm:"INDEX created"` + UpdatedUnix util.TimeStamp `xorm:"INDEX updated"` + } + + if err := x.Sync2(new(Review)); err != nil { + return fmt.Errorf("Sync2: %v", err) + } + return nil +}