Repository contains information of a repository.
| 163 | |
| 164 | // Repository contains information of a repository. |
| 165 | type Repository struct { |
| 166 | ID int64 `gorm:"primaryKey"` |
| 167 | OwnerID int64 `xorm:"UNIQUE(s)" gorm:"uniqueIndex:repo_owner_name_unique"` |
| 168 | Owner *User `xorm:"-" gorm:"-" json:"-"` |
| 169 | LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL" gorm:"uniqueIndex:repo_owner_name_unique;index;not null"` |
| 170 | Name string `xorm:"INDEX NOT NULL" gorm:"index;not null"` |
| 171 | Description string `xorm:"VARCHAR(512)" gorm:"type:VARCHAR(512)"` |
| 172 | Website string |
| 173 | DefaultBranch string |
| 174 | Size int64 `xorm:"NOT NULL DEFAULT 0" gorm:"not null;default:0"` |
| 175 | UseCustomAvatar bool |
| 176 | |
| 177 | // Counters |
| 178 | NumWatches int |
| 179 | NumStars int |
| 180 | NumForks int |
| 181 | NumIssues int |
| 182 | NumClosedIssues int |
| 183 | NumOpenIssues int `xorm:"-" gorm:"-" json:"-"` |
| 184 | NumPulls int |
| 185 | NumClosedPulls int |
| 186 | NumOpenPulls int `xorm:"-" gorm:"-" json:"-"` |
| 187 | NumMilestones int `xorm:"NOT NULL DEFAULT 0" gorm:"not null;default:0"` |
| 188 | NumClosedMilestones int `xorm:"NOT NULL DEFAULT 0" gorm:"not null;default:0"` |
| 189 | NumOpenMilestones int `xorm:"-" gorm:"-" json:"-"` |
| 190 | NumTags int `xorm:"-" gorm:"-" json:"-"` |
| 191 | |
| 192 | IsPrivate bool |
| 193 | // TODO: When migrate to GORM, make sure to do a loose migration with `HasColumn` and `AddColumn`, |
| 194 | // see docs in https://gorm.io/docs/migration.html. |
| 195 | IsUnlisted bool `xorm:"NOT NULL DEFAULT false" gorm:"not null;default:FALSE"` |
| 196 | IsBare bool |
| 197 | |
| 198 | IsMirror bool |
| 199 | *Mirror `xorm:"-" gorm:"-" json:"-"` |
| 200 | |
| 201 | // Advanced settings |
| 202 | EnableWiki bool `xorm:"NOT NULL DEFAULT true" gorm:"not null;default:TRUE"` |
| 203 | AllowPublicWiki bool |
| 204 | EnableExternalWiki bool |
| 205 | ExternalWikiURL string |
| 206 | EnableIssues bool `xorm:"NOT NULL DEFAULT true" gorm:"not null;default:TRUE"` |
| 207 | AllowPublicIssues bool |
| 208 | EnableExternalTracker bool |
| 209 | ExternalTrackerURL string |
| 210 | ExternalTrackerFormat string |
| 211 | ExternalTrackerStyle string |
| 212 | ExternalMetas map[string]string `xorm:"-" gorm:"-" json:"-"` |
| 213 | EnablePulls bool `xorm:"NOT NULL DEFAULT true" gorm:"not null;default:TRUE"` |
| 214 | PullsIgnoreWhitespace bool `xorm:"NOT NULL DEFAULT false" gorm:"not null;default:FALSE"` |
| 215 | PullsAllowRebase bool `xorm:"NOT NULL DEFAULT false" gorm:"not null;default:FALSE"` |
| 216 | |
| 217 | IsFork bool `xorm:"NOT NULL DEFAULT false" gorm:"not null;default:FALSE"` |
| 218 | ForkID int64 |
| 219 | BaseRepo *Repository `xorm:"-" gorm:"-" json:"-"` |
| 220 | |
| 221 | Created time.Time `xorm:"-" gorm:"-" json:"-"` |
| 222 | CreatedUnix int64 |
nothing calls this directly
no outgoing calls
no test coverage detected