This commit is contained in:
@@ -6,9 +6,9 @@ package v1_21
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
"gitea.dev/models/migrations/migrationtest"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
base.MainTest(m)
|
||||
migrationtest.MainTest(m)
|
||||
}
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
)
|
||||
|
||||
func DropCustomLabelsColumnOfActionRunner(x *xorm.Engine) error {
|
||||
func DropCustomLabelsColumnOfActionRunner(x db.EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func CreateVariableTable(x *xorm.Engine) error {
|
||||
func CreateVariableTable(x db.EngineMigration) error {
|
||||
type ActionVariable struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
OwnerID int64 `xorm:"UNIQUE(owner_repo_name)"`
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddTriggerEventToActionRun(x *xorm.Engine) error {
|
||||
func AddTriggerEventToActionRun(x db.EngineMigration) error {
|
||||
type ActionRun struct {
|
||||
TriggerEvent string
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ package v1_21
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
)
|
||||
|
||||
// AddGitSizeAndLFSSizeToRepositoryTable: add GitSize and LFSSize columns to Repository
|
||||
func AddGitSizeAndLFSSizeToRepositoryTable(x *xorm.Engine) error {
|
||||
func AddGitSizeAndLFSSizeToRepositoryTable(x db.EngineMigration) error {
|
||||
type Repository struct {
|
||||
GitSize int64 `xorm:"NOT NULL DEFAULT 0"`
|
||||
LFSSize int64 `xorm:"NOT NULL DEFAULT 0"`
|
||||
|
||||
@@ -7,13 +7,11 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func AddBranchTable(x *xorm.Engine) error {
|
||||
func AddBranchTable(x db.EngineMigration) error {
|
||||
type Branch struct {
|
||||
ID int64
|
||||
RepoID int64 `xorm:"UNIQUE(s)"`
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AlterActionArtifactTable(x *xorm.Engine) error {
|
||||
func AlterActionArtifactTable(x db.EngineMigration) error {
|
||||
// ActionArtifact is a file that is stored in the artifact storage.
|
||||
type ActionArtifact struct {
|
||||
RunID int64 `xorm:"index unique(runid_name_path)"` // The run id of the artifact
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func ReduceCommitStatus(x *xorm.Engine) error {
|
||||
func ReduceCommitStatus(x db.EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func CreateActionTasksVersionTable(x *xorm.Engine) error {
|
||||
func CreateActionTasksVersionTable(x db.EngineMigration) error {
|
||||
type ActionTasksVersion struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
OwnerID int64 `xorm:"UNIQUE(owner_repo)"`
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
// UpdateActionsRefIndex updates the index of actions ref field
|
||||
func UpdateActionsRefIndex(x *xorm.Engine) error {
|
||||
func UpdateActionsRefIndex(x db.EngineMigration) error {
|
||||
type ActionRun struct {
|
||||
Ref string `xorm:"index"` // the commit/tag/… causing the run
|
||||
}
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func DropDeletedBranchTable(x *xorm.Engine) error {
|
||||
func DropDeletedBranchTable(x db.EngineMigration) error {
|
||||
return x.DropTables("deleted_branch")
|
||||
}
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func FixPackagePropertyTypo(x *xorm.Engine) error {
|
||||
func FixPackagePropertyTypo(x db.EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func AddArchivedUnixColumInLabelTable(x *xorm.Engine) error {
|
||||
func AddArchivedUnixColumInLabelTable(x db.EngineMigration) error {
|
||||
type Label struct {
|
||||
ArchivedUnix timeutil.TimeStamp `xorm:"DEFAULT NULL"`
|
||||
}
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddVersionToActionRunTable(x *xorm.Engine) error {
|
||||
func AddVersionToActionRunTable(x db.EngineMigration) error {
|
||||
type ActionRun struct {
|
||||
Version int `xorm:"version default 0"`
|
||||
}
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func AddActionScheduleTable(x *xorm.Engine) error {
|
||||
func AddActionScheduleTable(x db.EngineMigration) error {
|
||||
type ActionSchedule struct {
|
||||
ID int64
|
||||
Title string
|
||||
|
||||
@@ -6,12 +6,11 @@ package v1_21
|
||||
import (
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func AddExpiredUnixColumnInActionArtifactTable(x *xorm.Engine) error {
|
||||
func AddExpiredUnixColumnInActionArtifactTable(x db.EngineMigration) error {
|
||||
type ActionArtifact struct {
|
||||
ExpiredUnix timeutil.TimeStamp `xorm:"index"` // time when the artifact will be expired
|
||||
}
|
||||
@@ -21,7 +20,7 @@ func AddExpiredUnixColumnInActionArtifactTable(x *xorm.Engine) error {
|
||||
return updateArtifactsExpiredUnixTo90Days(x)
|
||||
}
|
||||
|
||||
func updateArtifactsExpiredUnixTo90Days(x *xorm.Engine) error {
|
||||
func updateArtifactsExpiredUnixTo90Days(x db.EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddScheduleIDForActionRun(x *xorm.Engine) error {
|
||||
func AddScheduleIDForActionRun(x db.EngineMigration) error {
|
||||
type ActionRun struct {
|
||||
ScheduleID int64
|
||||
}
|
||||
|
||||
@@ -6,14 +6,13 @@ package v1_21
|
||||
import (
|
||||
"context"
|
||||
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/modules/gitrepo"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
repo_model "gitea.dev/models/repo"
|
||||
"gitea.dev/modules/gitrepo"
|
||||
"gitea.dev/modules/setting"
|
||||
)
|
||||
|
||||
func AddRemoteAddressToMirrors(x *xorm.Engine) error {
|
||||
func AddRemoteAddressToMirrors(x db.EngineMigration) error {
|
||||
type Mirror struct {
|
||||
RemoteAddress string `xorm:"VARCHAR(2048)"`
|
||||
}
|
||||
@@ -33,7 +32,7 @@ func AddRemoteAddressToMirrors(x *xorm.Engine) error {
|
||||
return migratePushMirrors(x)
|
||||
}
|
||||
|
||||
func migratePullMirrors(x *xorm.Engine) error {
|
||||
func migratePullMirrors(x db.EngineMigration) error {
|
||||
type Mirror struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64 `xorm:"INDEX"`
|
||||
@@ -95,7 +94,7 @@ func migratePullMirrors(x *xorm.Engine) error {
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
func migratePushMirrors(x *xorm.Engine) error {
|
||||
func migratePushMirrors(x db.EngineMigration) error {
|
||||
type PushMirror struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64 `xorm:"INDEX"`
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddIndexToIssueUserIssueID(x *xorm.Engine) error {
|
||||
func AddIndexToIssueUserIssueID(x db.EngineMigration) error {
|
||||
type IssueUser struct {
|
||||
IssueID int64 `xorm:"INDEX"`
|
||||
}
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddIndexToCommentDependentIssueID(x *xorm.Engine) error {
|
||||
func AddIndexToCommentDependentIssueID(x db.EngineMigration) error {
|
||||
type Comment struct {
|
||||
DependentIssueID int64 `xorm:"index"`
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
package v1_21
|
||||
|
||||
import (
|
||||
"gitea.dev/models/db"
|
||||
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
func AddIndexToActionUserID(x *xorm.Engine) error {
|
||||
func AddIndexToActionUserID(x db.EngineMigration) error {
|
||||
type Action struct {
|
||||
UserID int64 `xorm:"INDEX"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user