diff options
Diffstat (limited to 'models/repo_unit.go')
-rw-r--r-- | models/repo_unit.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/models/repo_unit.go b/models/repo_unit.go index 3f0e65f9ab..5100ca1ce2 100644 --- a/models/repo_unit.go +++ b/models/repo_unit.go @@ -6,7 +6,8 @@ package models import ( "encoding/json" - "time" + + "code.gitea.io/gitea/modules/util" "github.com/Unknwon/com" "github.com/go-xorm/core" @@ -19,8 +20,7 @@ type RepoUnit struct { RepoID int64 `xorm:"INDEX(s)"` Type UnitType `xorm:"INDEX(s)"` Config core.Conversion `xorm:"TEXT"` - CreatedUnix int64 `xorm:"INDEX CREATED"` - Created time.Time `xorm:"-"` + CreatedUnix util.TimeStamp `xorm:"INDEX CREATED"` } // UnitConfig describes common unit config @@ -105,11 +105,6 @@ func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell) { } } -// AfterLoad is invoked from XORM after setting the values of all fields of this object. -func (r *RepoUnit) AfterLoad() { - r.Created = time.Unix(r.CreatedUnix, 0).Local() -} - // Unit returns Unit func (r *RepoUnit) Unit() Unit { return Units[r.Type] |