Add Primary Key to Topic and RepoTopic (#12639)
Add a primary key to Topic and RepoTopic tables Fix #8920 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
@ -25,7 +25,7 @@ var topicPattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-]*$`)
|
||||
|
||||
// Topic represents a topic of repositories
|
||||
type Topic struct {
|
||||
ID int64
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Name string `xorm:"UNIQUE VARCHAR(25)"`
|
||||
RepoCount int
|
||||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
||||
@ -34,8 +34,8 @@ type Topic struct {
|
||||
|
||||
// RepoTopic represents associated repositories and topics
|
||||
type RepoTopic struct {
|
||||
RepoID int64 `xorm:"UNIQUE(s)"`
|
||||
TopicID int64 `xorm:"UNIQUE(s)"`
|
||||
RepoID int64 `xorm:"pk"`
|
||||
TopicID int64 `xorm:"pk"`
|
||||
}
|
||||
|
||||
// ErrTopicNotExist represents an error that a topic is not exist
|
||||
|
Reference in New Issue
Block a user