add commit model

master
Vitaliy Filippov 2017-04-10 01:33:33 +03:00
parent 6ea9642d64
commit b2db4afe77
2 changed files with 28 additions and 1 deletions

27
models/commit.go Normal file
View File

@ -0,0 +1,27 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
"time"
)
type Commit struct {
ID int64
RepoID int64 `xorm:"UNIQUE(commit_repo_sha)"`
Sha string `xorm:"VARCHAR(40) UNIQUE(commit_repo_sha)"`
Message string
AuthorEmail string
AuthorName string
AuthorTime time.Time
CommitterEmail string
CommitterName string
CommitterTime time.Time
}
type CommitParent struct {
ParentId int64 `xorm:"pk"`
ChildId int64 `xorm:"pk"`
}

View File

@ -72,7 +72,7 @@ func init() {
new(Mirror), new(Release), new(LoginSource), new(Webhook), new(HookTask),
new(ProtectBranch), new(ProtectBranchWhitelist),
new(Team), new(OrgUser), new(TeamUser), new(TeamRepo),
new(Notice), new(EmailAddress))
new(Notice), new(EmailAddress), new(Commit), new(CommitParent))
gonicNames := []string{"SSL"}
for _, name := range gonicNames {