mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-19 02:43:18 +00:00
chore: rename 'forgejo_migrations' to 'forgejo_migrations_legacy'
This commit is contained in:
parent
a0be0f22fc
commit
49bcd792cd
58 changed files with 50 additions and 50 deletions
4
Makefile
4
Makefile
|
@ -287,14 +287,14 @@ show-version-api: verify-version
|
|||
.PHONY: compute-go-test-packages
|
||||
compute-go-test-packages:
|
||||
ifeq ($(HAS_GO), yes)
|
||||
$(eval GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list forgejo.org/models/gitea_migrations/...) $(shell $(GO) list forgejo.org/models/forgejo_migrations/...) forgejo.org/tests/integration/migration-test forgejo.org/tests forgejo.org/tests/integration forgejo.org/tests/e2e,$(shell $(GO) list ./...)))
|
||||
$(eval GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list forgejo.org/models/gitea_migrations/...) $(shell $(GO) list forgejo.org/models/forgejo_migrations_legacy/...) forgejo.org/tests/integration/migration-test forgejo.org/tests forgejo.org/tests/integration forgejo.org/tests/e2e,$(shell $(GO) list ./...)))
|
||||
endif
|
||||
|
||||
# Target to compute MIGRATION_PACKAGES - only runs when needed
|
||||
.PHONY: compute-migration-packages
|
||||
compute-migration-packages:
|
||||
ifeq ($(HAS_GO), yes)
|
||||
$(eval MIGRATION_PACKAGES := $(shell $(GO) list forgejo.org/models/gitea_migrations/... forgejo.org/models/forgejo_migrations/...))
|
||||
$(eval MIGRATION_PACKAGES := $(shell $(GO) list forgejo.org/models/gitea_migrations/... forgejo.org/models/forgejo_migrations_legacy/...))
|
||||
endif
|
||||
|
||||
###
|
||||
|
|
|
@ -9,7 +9,7 @@ PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
|
|||
# would interfere with the testing fixtures.
|
||||
#
|
||||
excluded+='forgejo.org/models/gitea_migrations|' # must be run before database specific tests
|
||||
excluded+='forgejo.org/models/forgejo_migrations|' # must be run before database specific tests
|
||||
excluded+='forgejo.org/models/forgejo_migrations_legacy|' # must be run before database specific tests
|
||||
excluded+='forgejo.org/tests/integration/migration-test|' # must be run before database specific tests
|
||||
excluded+='forgejo.org/tests|' # only tests, no coverage to get there
|
||||
excluded+='forgejo.org/tests/e2e|' # JavaScript is not in scope here and if it adds coverage it should not be counted
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2023 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2023 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -10,8 +10,8 @@ import (
|
|||
"os"
|
||||
|
||||
"forgejo.org/models/forgejo/semver"
|
||||
forgejo_v1_20 "forgejo.org/models/forgejo_migrations/v1_20"
|
||||
forgejo_v1_22 "forgejo.org/models/forgejo_migrations/v1_22"
|
||||
forgejo_v1_20 "forgejo.org/models/forgejo_migrations_legacy/v1_20"
|
||||
forgejo_v1_22 "forgejo.org/models/forgejo_migrations_legacy/v1_22"
|
||||
"forgejo.org/modules/git"
|
||||
"forgejo.org/modules/log"
|
||||
"forgejo.org/modules/setting"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2023 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"forgejo.org/models/gitea_migrations/base"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"time"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"context"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"forgejo.org/modules/timeutil"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"database/sql"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"time"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"bytes"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"forgejo.org/modules/timeutil"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"context"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"errors"
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package forgejo_migrations
|
||||
package forgejo_migrations_legacy
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
|
@ -10,7 +10,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"forgejo.org/models/db"
|
||||
"forgejo.org/models/forgejo_migrations"
|
||||
"forgejo.org/models/forgejo_migrations_legacy"
|
||||
"forgejo.org/models/gitea_migrations/v1_10"
|
||||
"forgejo.org/models/gitea_migrations/v1_11"
|
||||
"forgejo.org/models/gitea_migrations/v1_12"
|
||||
|
@ -367,7 +367,7 @@ func prepareMigrationTasks() []*migration {
|
|||
|
||||
// Migration to Forgejo v10
|
||||
newMigration(303, "Gitea last drop", v1_23.GiteaLastDrop),
|
||||
newMigration(304, "Migrate `secret` column to store keying material", forgejo_migrations.MigrateTwoFactorToKeying),
|
||||
newMigration(304, "Migrate `secret` column to store keying material", forgejo_migrations_legacy.MigrateTwoFactorToKeying),
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ func EnsureUpToDate(x *xorm.Engine) error {
|
|||
return fmt.Errorf(`current database version %d is not equal to the expected version %d. Please run "forgejo [--config /path/to/app.ini] migrate" to update the database version`, currentDB, expectedDB)
|
||||
}
|
||||
|
||||
return forgejo_migrations.EnsureUpToDate(x)
|
||||
return forgejo_migrations_legacy.EnsureUpToDate(x)
|
||||
}
|
||||
|
||||
func getPendingMigrations(curDBVer int64, migrations []*migration) []*migration {
|
||||
|
@ -510,7 +510,7 @@ Please try upgrading to a lower version first (suggested v1.6.4), then upgrade t
|
|||
}
|
||||
|
||||
// Execute Forgejo specific migrations.
|
||||
return forgejo_migrations.Migrate(x)
|
||||
return forgejo_migrations_legacy.Migrate(x)
|
||||
}
|
||||
|
||||
// WrapperMigrate is a wrapper for Migrate to be called in diagnostics
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue