mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-19 00:10:15 +00:00
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:
parent
4f8dad37f8
commit
47289344e2
3 changed files with 44 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue