aboutsummaryrefslogtreecommitdiffstats
path: root/models/branches.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/branches.go')
-rw-r--r--models/branches.go15
1 files changed, 2 insertions, 13 deletions
diff --git a/models/branches.go b/models/branches.go
index 6115f9c687..4461da0067 100644
--- a/models/branches.go
+++ b/models/branches.go
@@ -22,20 +22,9 @@ type ProtectedBranch struct {
BranchName string `xorm:"UNIQUE(s)"`
CanPush bool
Created time.Time `xorm:"-"`
- CreatedUnix int64
+ CreatedUnix int64 `xorm:"created"`
Updated time.Time `xorm:"-"`
- UpdatedUnix int64
-}
-
-// BeforeInsert before protected branch insert create and update time
-func (protectBranch *ProtectedBranch) BeforeInsert() {
- protectBranch.CreatedUnix = time.Now().Unix()
- protectBranch.UpdatedUnix = protectBranch.CreatedUnix
-}
-
-// BeforeUpdate before protected branch update time
-func (protectBranch *ProtectedBranch) BeforeUpdate() {
- protectBranch.UpdatedUnix = time.Now().Unix()
+ UpdatedUnix int64 `xorm:"updated"`
}
// GetProtectedBranchByRepoID getting protected branch by repo ID