Skip to content

Commit f05b354

Browse files
committed
remove unused table
1 parent a606860 commit f05b354

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

models/commit_status.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -219,23 +219,6 @@ func NewCommitStatus(opts NewCommitStatusOptions) error {
219219
return fmt.Errorf("Insert CommitStatus[%s, %s]: %v", repoPath, opts.SHA, err)
220220
}
221221

222-
exist, err := sess.Table("commit_status_context").
223-
Where("repo_id =? AND context_hash = ?", opts.Repo.ID, opts.CommitStatus.ContextHash).
224-
Exist()
225-
if err != nil {
226-
return fmt.Errorf("Check CommistStatusContext Exist failed: %v", err)
227-
}
228-
if !exist {
229-
if _, err = sess.Insert(&CommitStatusContext{
230-
RepoID: opts.Repo.ID,
231-
ContextHash: opts.CommitStatus.ContextHash,
232-
ContextLogo: "",
233-
Context: opts.CommitStatus.Context,
234-
}); err != nil {
235-
return fmt.Errorf("Insert CommitStatusContext[%s, %s]: %v", repoPath, opts.SHA, err)
236-
}
237-
}
238-
239222
return sess.Commit()
240223
}
241224

@@ -274,27 +257,3 @@ func ParseCommitsWithStatus(oldCommits *list.List, repo *Repository) *list.List
274257
func HashCommitStatusContext(context string) string {
275258
return fmt.Sprintf("%x", md5.Sum([]byte(context)))
276259
}
277-
278-
// CommitStatusContext represents commit status context
279-
type CommitStatusContext struct {
280-
ID int64
281-
RepoID int64 `xorm:"index unique(s)"`
282-
ContextHash string `xorm:"varchar(40) unique(s)"`
283-
ContextLogo string `xorm:"TEXT"`
284-
Context string `xorm:"TEXT"`
285-
CreatedUnix util.TimeStamp `xorm:"created"`
286-
}
287-
288-
// FindRepoCommitStatusContexts find repository's commit status contexts
289-
func FindRepoCommitStatusContexts(repoID int64) ([]string, error) {
290-
var contexts = make([]string, 0, 3)
291-
err := x.Where("repo_id = ?", repoID).Table("commit_status_context").Find(&contexts)
292-
if err != nil {
293-
return nil, err
294-
}
295-
return contexts, nil
296-
}
297-
298-
func init() {
299-
tables = append(tables, new(CommitStatusContext))
300-
}

models/migrations/v88.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import (
88
"crypto/md5"
99
"fmt"
1010

11-
"code.gitea.io/gitea/modules/util"
12-
1311
"github.com/go-xorm/xorm"
1412
)
1513

@@ -64,14 +62,5 @@ func addCommitStatusContext(x *xorm.Engine) error {
6462
start += len(statuses)
6563
}
6664

67-
type CommitStatusContext struct {
68-
ID int64
69-
RepoID int64 `xorm:"index unique(s)"`
70-
ContextHash string `xorm:"varchar(40) unique(s)"`
71-
ContextLogo string `xorm:"TEXT"`
72-
Context string `xorm:"TEXT"`
73-
CreatedUnix util.TimeStamp `xorm:"created"`
74-
}
75-
76-
return x.Sync2(new(CommitStatusContext))
65+
return nil
7766
}

0 commit comments

Comments
 (0)