Moved struct inside migration

Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
Konrad Langenberg 2017-10-10 23:24:17 +02:00 committed by Konrad
parent c5e35e93ef
commit fda0b71fce

View File

@ -7,14 +7,24 @@ package migrations
import (
"fmt"
"code.gitea.io/gitea/models"
"github.com/go-xorm/xorm"
"time"
)
func addIssueDependencyTables(x *xorm.Engine) (err error) {
err = x.Sync(new(models.IssueDependency))
type IssueDependency struct {
ID int64 `xorm:"pk autoincr"`
UserID int64 `xorm:"UNIQUE(watch) NOT NULL"`
IssueID int64 `xorm:"UNIQUE(watch) NOT NULL"`
DependencyID int64 `xorm:"UNIQUE(watch) NOT NULL"`
Created time.Time `xorm:"-"`
CreatedUnix int64 `xorm:"INDEX created"`
Updated time.Time `xorm:"-"`
UpdatedUnix int64 `xorm:"updated"`
}
err = x.Sync(new(IssueDependency))
if err != nil {
return fmt.Errorf("Error creating issue_dependency_table column definition: %v", err)