This commit is contained in:
@@ -6,9 +6,9 @@ package v1_15
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_15
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddLFSMirrorColumns(x *xorm.Engine) error {
|
||||
func AddLFSMirrorColumns(x db.EngineMigration) error {
|
||||
type Mirror struct {
|
||||
LFS bool `xorm:"lfs_enabled NOT NULL DEFAULT false"`
|
||||
LFSEndpoint string `xorm:"lfs_endpoint TEXT"`
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
package v1_15
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"xorm.io/xorm/schemas"
|
||||
)
|
||||
|
||||
func ConvertAvatarURLToText(x *xorm.Engine) error {
|
||||
func ConvertAvatarURLToText(x db.EngineMigration) error {
|
||||
dbType := x.Dialect().URI().DBType
|
||||
if dbType == schemas.SQLITE { // For SQLITE, varchar or char will always be represented as TEXT
|
||||
return nil
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
package v1_15
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/json"
|
||||
"gitea.dev/modules/util"
|
||||
|
||||
"xorm.io/builder"
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
func DeleteMigrationCredentials(x *xorm.Engine) (err error) {
|
||||
func DeleteMigrationCredentials(x db.EngineMigration) (err error) {
|
||||
// Task represents a task
|
||||
type Task struct {
|
||||
ID int64
|
||||
|
||||
@@ -6,10 +6,10 @@ package v1_15
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
)
|
||||
|
||||
func AddPrimaryEmail2EmailAddress(x *xorm.Engine) error {
|
||||
func AddPrimaryEmail2EmailAddress(x db.EngineMigration) error {
|
||||
type User struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Email string `xorm:"NOT NULL"`
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
"gitea.dev/models/migrations/migrationtest"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -20,7 +20,7 @@ func Test_AddPrimaryEmail2EmailAddress(t *testing.T) {
|
||||
}
|
||||
|
||||
// Prepare and load the testing database
|
||||
x, deferable := base.PrepareTestEnv(t, 0, new(User))
|
||||
x, deferable := migrationtest.PrepareTestEnv(t, 0, new(User))
|
||||
if x == nil || t.Failed() {
|
||||
defer deferable()
|
||||
return
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_15
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddIssueResourceIndexTable(x *xorm.Engine) error {
|
||||
func AddIssueResourceIndexTable(x db.EngineMigration) error {
|
||||
type ResourceIndex struct {
|
||||
GroupID int64 `xorm:"pk"`
|
||||
MaxIndex int64 `xorm:"index"`
|
||||
|
||||
@@ -6,7 +6,7 @@ package v1_15
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
"gitea.dev/models/migrations/migrationtest"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -20,7 +20,7 @@ func Test_AddIssueResourceIndexTable(t *testing.T) {
|
||||
}
|
||||
|
||||
// Prepare and load the testing database
|
||||
x, deferable := base.PrepareTestEnv(t, 0, new(Issue))
|
||||
x, deferable := migrationtest.PrepareTestEnv(t, 0, new(Issue))
|
||||
if x == nil || t.Failed() {
|
||||
defer deferable()
|
||||
return
|
||||
|
||||
@@ -7,12 +7,11 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func CreatePushMirrorTable(x *xorm.Engine) error {
|
||||
func CreatePushMirrorTable(x db.EngineMigration) error {
|
||||
type PushMirror struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64 `xorm:"INDEX"`
|
||||
|
||||
@@ -7,13 +7,12 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
"gitea.dev/modules/setting"
|
||||
)
|
||||
|
||||
func RenameTaskErrorsToMessage(x *xorm.Engine) error {
|
||||
func RenameTaskErrorsToMessage(x db.EngineMigration) error {
|
||||
type Task struct {
|
||||
Errors string `xorm:"TEXT"` // if task failed, saved the error reason
|
||||
Type int
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
package v1_15
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddRepoArchiver(x *xorm.Engine) error {
|
||||
func AddRepoArchiver(x db.EngineMigration) error {
|
||||
// RepoArchiver represents all archivers
|
||||
type RepoArchiver struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
package v1_15
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func CreateProtectedTagTable(x *xorm.Engine) error {
|
||||
func CreateProtectedTagTable(x db.EngineMigration) error {
|
||||
type ProtectedTag struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
package v1_15
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
)
|
||||
|
||||
func DropWebhookColumns(x *xorm.Engine) error {
|
||||
func DropWebhookColumns(x db.EngineMigration) error {
|
||||
// Make sure the columns exist before dropping them
|
||||
type Webhook struct {
|
||||
Signature string `xorm:"TEXT"`
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_15
|
||||
|
||||
import "xorm.io/xorm"
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func AddKeyIsVerified(x *xorm.Engine) error {
|
||||
func AddKeyIsVerified(x db.EngineMigration) error {
|
||||
type GPGKey struct {
|
||||
Verified bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user