This commit is contained in:
@@ -4,12 +4,11 @@
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
)
|
||||
|
||||
func DropColumnHeadUserNameOnPullRequest(x *xorm.Engine) error {
|
||||
func DropColumnHeadUserNameOnPullRequest(x db.EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
if err := sess.Begin(); err != nil {
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddWhitelistDeployKeysToBranches(x *xorm.Engine) error {
|
||||
func AddWhitelistDeployKeysToBranches(x db.EngineMigration) error {
|
||||
type ProtectedBranch struct {
|
||||
ID int64
|
||||
WhitelistDeployKeys bool `xorm:"NOT NULL DEFAULT false"`
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
)
|
||||
|
||||
func RemoveLabelUneededCols(x *xorm.Engine) error {
|
||||
func RemoveLabelUneededCols(x db.EngineMigration) error {
|
||||
// Make sure the columns exist before dropping them
|
||||
type Label struct {
|
||||
QueryString string
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddTeamIncludesAllRepositories(x *xorm.Engine) error {
|
||||
func AddTeamIncludesAllRepositories(x db.EngineMigration) error {
|
||||
type Team struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
IncludesAllRepositories bool `xorm:"NOT NULL DEFAULT false"`
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
// RepoWatchMode specifies what kind of watch the user has on a repository
|
||||
type RepoWatchMode int8
|
||||
@@ -16,7 +14,7 @@ type Watch struct {
|
||||
Mode RepoWatchMode `xorm:"SMALLINT NOT NULL DEFAULT 1"`
|
||||
}
|
||||
|
||||
func AddModeColumnToWatch(x *xorm.Engine) error {
|
||||
func AddModeColumnToWatch(x db.EngineMigration) error {
|
||||
if err := x.Sync(new(Watch)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddTemplateToRepo(x *xorm.Engine) error {
|
||||
func AddTemplateToRepo(x db.EngineMigration) error {
|
||||
type Repository struct {
|
||||
IsTemplate bool `xorm:"INDEX NOT NULL DEFAULT false"`
|
||||
TemplateID int64 `xorm:"INDEX"`
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddCommentIDOnNotification(x *xorm.Engine) error {
|
||||
func AddCommentIDOnNotification(x db.EngineMigration) error {
|
||||
type Notification struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CommentID int64
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddCanCreateOrgRepoColumnForTeam(x *xorm.Engine) error {
|
||||
func AddCanCreateOrgRepoColumnForTeam(x db.EngineMigration) error {
|
||||
type Team struct {
|
||||
CanCreateOrgRepo bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
|
||||
"xorm.io/xorm/schemas"
|
||||
)
|
||||
|
||||
func ChangeReviewContentToText(x *xorm.Engine) error {
|
||||
func ChangeReviewContentToText(x db.EngineMigration) error {
|
||||
switch x.Dialect().URI().DBType {
|
||||
case schemas.MYSQL:
|
||||
_, err := x.Exec("ALTER TABLE review MODIFY COLUMN content TEXT")
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"fmt"
|
||||
"slices"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
)
|
||||
|
||||
func AddBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error {
|
||||
func AddBranchProtectionCanPushAndEnableWhitelist(x db.EngineMigration) error {
|
||||
type ProtectedBranch struct {
|
||||
CanPush bool `xorm:"NOT NULL DEFAULT false"`
|
||||
EnableApprovalsWhitelist bool `xorm:"NOT NULL DEFAULT false"`
|
||||
@@ -132,7 +132,7 @@ func AddBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error {
|
||||
}
|
||||
|
||||
// getUserRepoPermission static function based on issues_model.IsOfficialReviewer at 5d78792385
|
||||
getUserRepoPermission := func(sess *xorm.Session, repo *Repository, user *User) (Permission, error) {
|
||||
getUserRepoPermission := func(sess db.Session, repo *Repository, user *User) (Permission, error) {
|
||||
var perm Permission
|
||||
|
||||
repoOwner := new(User)
|
||||
@@ -305,7 +305,7 @@ func AddBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error {
|
||||
}
|
||||
|
||||
// isOfficialReviewer static function based on 5d78792385
|
||||
isOfficialReviewer := func(sess *xorm.Session, issueID int64, reviewer *User) (bool, error) {
|
||||
isOfficialReviewer := func(sess db.Session, issueID int64, reviewer *User) (bool, error) {
|
||||
pr := new(PullRequest)
|
||||
has, err := sess.ID(issueID).Get(pr)
|
||||
if err != nil {
|
||||
|
||||
@@ -6,15 +6,15 @@ package v1_11
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/setting"
|
||||
"gitea.dev/modules/util"
|
||||
|
||||
"xorm.io/builder"
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
func RemoveAttachmentMissedRepo(x *xorm.Engine) error {
|
||||
func RemoveAttachmentMissedRepo(x db.EngineMigration) error {
|
||||
type Attachment struct {
|
||||
UUID string `xorm:"uuid"`
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ package v1_11
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
)
|
||||
|
||||
func FeatureChangeTargetBranch(x *xorm.Engine) error {
|
||||
func FeatureChangeTargetBranch(x db.EngineMigration) error {
|
||||
type Comment struct {
|
||||
OldRef string
|
||||
NewRef string
|
||||
|
||||
@@ -6,10 +6,10 @@ package v1_11
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
)
|
||||
|
||||
func SanitizeOriginalURL(x *xorm.Engine) error {
|
||||
func SanitizeOriginalURL(x db.EngineMigration) error {
|
||||
type Repository struct {
|
||||
ID int64
|
||||
OriginalURL string `xorm:"VARCHAR(2048)"`
|
||||
|
||||
@@ -12,15 +12,14 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/container"
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/setting"
|
||||
"gitea.dev/modules/util"
|
||||
)
|
||||
|
||||
func RenameExistingUserAvatarName(x *xorm.Engine) error {
|
||||
func RenameExistingUserAvatarName(x db.EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func ExtendTrackedTimes(x *xorm.Engine) error {
|
||||
func ExtendTrackedTimes(x db.EngineMigration) error {
|
||||
type TrackedTime struct {
|
||||
Time int64 `xorm:"NOT NULL"`
|
||||
Deleted bool `xorm:"NOT NULL DEFAULT false"`
|
||||
|
||||
Reference in New Issue
Block a user