diff options
Diffstat (limited to 'models/lfs.go')
-rw-r--r-- | models/lfs.go | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/models/lfs.go b/models/lfs.go index d6cdc68892..711e5b0494 100644 --- a/models/lfs.go +++ b/models/lfs.go @@ -2,18 +2,18 @@ package models import ( "errors" - "time" + + "code.gitea.io/gitea/modules/util" ) // LFSMetaObject stores metadata for LFS tracked files. type LFSMetaObject struct { - ID int64 `xorm:"pk autoincr"` - Oid string `xorm:"UNIQUE(s) INDEX NOT NULL"` - Size int64 `xorm:"NOT NULL"` - RepositoryID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` - Existing bool `xorm:"-"` - Created time.Time `xorm:"-"` - CreatedUnix int64 `xorm:"created"` + ID int64 `xorm:"pk autoincr"` + Oid string `xorm:"UNIQUE(s) INDEX NOT NULL"` + Size int64 `xorm:"NOT NULL"` + RepositoryID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` + Existing bool `xorm:"-"` + CreatedUnix util.TimeStamp `xorm:"created"` } // LFSTokenResponse defines the JSON structure in which the JWT token is stored. @@ -105,8 +105,3 @@ func (repo *Repository) RemoveLFSMetaObjectByOid(oid string) error { return sess.Commit() } - -// AfterLoad stores the LFSMetaObject creation time in the database as local time. -func (m *LFSMetaObject) AfterLoad() { - m.Created = time.Unix(m.CreatedUnix, 0).Local() -} |