Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions server/model/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ func (mode ApprovalMode) Valid() bool {
type Repo struct {
ID int64 `json:"id,omitempty" xorm:"pk autoincr 'id'"`
UserID int64 `json:"-" xorm:"INDEX 'user_id'"`
ForgeID int64 `json:"forge_id,omitempty" xorm:"UNIQUE(forge) forge_id"`
ForgeID int64 `json:"forge_id,omitempty" xorm:"UNIQUE(forge) UNIQUE(name) UNIQUE(full_name) forge_id"`
// ForgeRemoteID is the unique identifier for the repository on the forge.
ForgeRemoteID ForgeRemoteID `json:"forge_remote_id" xorm:"UNIQUE(forge) forge_remote_id"`
OrgID int64 `json:"org_id" xorm:"INDEX 'org_id'"`
Owner string `json:"owner" xorm:"UNIQUE(name) 'owner'"`
Name string `json:"name" xorm:"UNIQUE(name) 'name'"`
FullName string `json:"full_name" xorm:"UNIQUE 'full_name'"`
FullName string `json:"full_name" xorm:"UNIQUE(full_name) 'full_name'"`
Avatar string `json:"avatar_url,omitempty" xorm:"varchar(500) 'avatar'"`
ForgeURL string `json:"forge_url,omitempty" xorm:"varchar(1000) 'forge_url'"`
Clone string `json:"clone_url,omitempty" xorm:"varchar(1000) 'clone'"`
Expand All @@ -69,7 +69,6 @@ type Repo struct {
AllowDeploy bool `json:"allow_deploy" xorm:"allow_deploy"`
Config string `json:"config_file" xorm:"varchar(500) 'config_path'"`
Hash string `json:"-" xorm:"varchar(500) 'hash'"`
Perm *Perm `json:"-" xorm:"-"`
CancelPreviousPipelineEvents []WebhookEvent `json:"cancel_previous_pipeline_events" xorm:"json 'cancel_previous_pipeline_events'"`
NetrcTrustedPlugins []string `json:"netrc_trusted" xorm:"json 'netrc_trusted'"`
ConfigExtensionEndpoint string `json:"config_extension_endpoint" xorm:"varchar(500) 'config_extension_endpoint'"`
Expand All @@ -79,6 +78,10 @@ type Repo struct {
RegistryExtensionNetrc bool `json:"registry_extension_netrc" xorm:"DEFAULT FALSE 'registry_extension_netrc'"`
SecretExtensionEndpoint string `json:"secret_extension_endpoint" xorm:"varchar(500) 'secret_extension_endpoint'"`
SecretExtensionNetrc bool `json:"secret_extension_netrc" xorm:"DEFAULT FALSE 'secret_extension_netrc'"`

// internal usage

Perm *Perm `json:"-" xorm:"-"`
} // @name Repo

// TableName return database table name for xorm.
Expand Down