mirror of
https://github.com/go-gitea/gitea.git
synced 2025-02-02 15:09:33 -05:00
Add DefaultUnit to Repository
This commit is contained in:
parent
348d1d0f32
commit
371cc207be
@ -364,6 +364,7 @@ func prepareMigrationTasks() []*migration {
|
||||
newMigration(304, "Add index for release sha1", v1_23.AddIndexForReleaseSha1),
|
||||
newMigration(305, "Add Repository Licenses", v1_23.AddRepositoryLicenses),
|
||||
newMigration(306, "Add BlockAdminMergeOverride to ProtectedBranch", v1_23.AddBlockAdminMergeOverrideBranchProtection),
|
||||
newMigration(307, "Add DefaultUnit to Repository", v1_23.AddDefaultUnitToRepository),
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
13
models/migrations/v1_23/v307.go
Normal file
13
models/migrations/v1_23/v307.go
Normal file
@ -0,0 +1,13 @@
|
||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_23 //nolint
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
||||
func AddDefaultUnitToRepository(x *xorm.Engine) error {
|
||||
type Repository struct {
|
||||
DefaultUnit int `xorm:"NOT NULL DEFAULT 1"`
|
||||
}
|
||||
return x.Sync(new(Repository))
|
||||
}
|
@ -168,6 +168,7 @@ type Repository struct {
|
||||
RenderingMetas map[string]string `xorm:"-"`
|
||||
DocumentRenderingMetas map[string]string `xorm:"-"`
|
||||
Units []*RepoUnit `xorm:"-"`
|
||||
DefaultUnit unit.Type `xorm:"NOT NULL DEFAULT 1"`
|
||||
PrimaryLanguage *LanguageStat `xorm:"-"`
|
||||
|
||||
IsFork bool `xorm:"INDEX NOT NULL DEFAULT false"`
|
||||
|
Loading…
Reference in New Issue
Block a user