Make owners and repos case insensitive
Github treats owners (users and orgs) and repos as case insensitive. To github, https://github.com/cloudbase/garm is equivalent to https://github.com/CloudBase/GaRm. This commit makes the sql store backend, case insensitive when querying repos and orgs. Fixes: #25 Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
8ca9a82529
commit
0ff2fd2e06
9 changed files with 30 additions and 12 deletions
|
|
@ -78,8 +78,8 @@ type Repository struct {
|
|||
Base
|
||||
|
||||
CredentialsName string
|
||||
Owner string `gorm:"index:idx_owner,unique"`
|
||||
Name string `gorm:"index:idx_owner,unique"`
|
||||
Owner string `gorm:"index:idx_owner_nocase,unique,collate:nocase"`
|
||||
Name string `gorm:"index:idx_owner_nocase,unique,collate:nocase"`
|
||||
WebhookSecret []byte
|
||||
Pools []Pool `gorm:"foreignKey:RepoID"`
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ type Organization struct {
|
|||
Base
|
||||
|
||||
CredentialsName string
|
||||
Name string `gorm:"uniqueIndex"`
|
||||
Name string `gorm:"index:idx_org_name_nocase,collate:nocase"`
|
||||
WebhookSecret []byte
|
||||
Pools []Pool `gorm:"foreignKey:OrgID"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue