Moved struct inside migration
Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
parent
c5e35e93ef
commit
fda0b71fce
|
|
@ -7,14 +7,24 @@ package migrations
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
|
||||||
|
|
||||||
"github.com/go-xorm/xorm"
|
"github.com/go-xorm/xorm"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func addIssueDependencyTables(x *xorm.Engine) (err error) {
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating issue_dependency_table column definition: %v", err)
|
return fmt.Errorf("Error creating issue_dependency_table column definition: %v", err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user