summaryrefslogtreecommitdiffstats
path: root/models/migrations/v35.go
blob: 7746663a40a8a3bda91eba71f91b417ee328b7d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2017 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"

	"github.com/go-xorm/xorm"
)

func addCommentIDToAction(x *xorm.Engine) error {
	// Action see models/action.go
	type Action struct {
		CommentID int64 `xorm:"INDEX"`
		IsDeleted bool  `xorm:"INDEX NOT NULL DEFAULT false"`
	}

	if err := x.Sync2(new(Action)); err != nil {
		return fmt.Errorf("Sync2: %v", err)
	}

	return nil
}