Browse Source

Create issue_watch table

tags/v1.2.0-rc1
Andrey Nering 7 years ago
parent
commit
a0d0de7233
2 changed files with 21 additions and 0 deletions
  1. 20
    0
      models/issue_watch.go
  2. 1
    0
      models/models.go

+ 20
- 0
models/issue_watch.go View File

@@ -0,0 +1,20 @@
package models

import (
"time"
)

// IssueWatch is connection request for receiving issue notification.
type IssueWatch struct {
ID int64 `xorm:"pk autoincr"`
UserID int64 `xorm:"UNIQUE(watch) NOT NULL"`
IssueID int64 `xorm:"UNIQUE(watch) NOT NULL"`
IsWatching bool `xorm:"NOT NULL"`
Created time.Time `xorm:"-"`
CreatedUnix int64 `xorm:"NOT NULL"`
}

// BeforeInsert is invoked from XORM before inserting an object of this type.
func (iw *IssueWatch) BeforeInsert() {
iw.CreatedUnix = time.Now().Unix()
}

+ 1
- 0
models/models.go View File

@@ -117,6 +117,7 @@ func init() {
new(ExternalLoginUser),
new(ProtectedBranch),
new(UserOpenID),
new(IssueWatch),
)

gonicNames := []string{"SSL", "UID"}

Loading…
Cancel
Save