diff --git a/models/commit.go b/models/commit.go new file mode 100644 index 00000000..9701c1be --- /dev/null +++ b/models/commit.go @@ -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"` +} diff --git a/models/models.go b/models/models.go index 98a4fd23..ab3ccf19 100644 --- a/models/models.go +++ b/models/models.go @@ -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 {