Skip to content

Deprecate very old migrations #9953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
guillep2k opened this issue Jan 23, 2020 · 4 comments · Fixed by #10026
Closed

Deprecate very old migrations #9953

guillep2k opened this issue Jan 23, 2020 · 4 comments · Fixed by #10026
Labels
type/enhancement An improvement of existing functionality

Comments

@guillep2k
Copy link
Member

Gitea version: 1.12

I've seen many issues with users being unable to upgrade directly from their very old version into 1.9, 1.10, etc. Our usual response (which solves their problem) is to attempt migrating in smaller steps (e.g. 1.4.x -> 1.5.3, 1.5.x -> 1.6.4, etc.).

Since upgrading from such old versions seems broken, what if (just this time, not as a regular thing) we stop supporting migrating versions prior to (say) 1.6.0, and force users to use older giteas to do the intermediate steps? There's already code for that, but the bar is set at 0.6.0.

const minDBVersion = 4

var migrations = []Migration{
// v0 -> v4: before 0.6.0 -> 0.7.33
NewMigration("fix locale file load panic", fixLocaleFileLoadPanic), // V4 -> V5:v0.6.0
NewMigration("trim action compare URL prefix", trimCommitActionAppURLPrefix), // V5 -> V6:v0.6.3
NewMigration("generate issue-label from issue", issueToIssueLabel), // V6 -> V7:v0.6.4
NewMigration("refactor attachment table", attachmentRefactor), // V7 -> V8:v0.6.4
NewMigration("rename pull request fields", renamePullRequestFields), // V8 -> V9:v0.6.16
NewMigration("clean up migrate repo info", cleanUpMigrateRepoInfo), // V9 -> V10:v0.6.20
NewMigration("generate rands and salt for organizations", generateOrgRandsAndSalt), // V10 -> V11:v0.8.5
NewMigration("convert date to unix timestamp", convertDateToUnix), // V11 -> V12:v0.9.2
NewMigration("convert LDAP UseSSL option to SecurityProtocol", ldapUseSSLToSecurityProtocol), // V12 -> V13:v0.9.37
// v13 -> v14:v0.9.87
NewMigration("set comment updated with created", setCommentUpdatedWithCreated),
// v14 -> v15
NewMigration("create user column diff view style", createUserColumnDiffViewStyle),
// v15 -> v16

v := currentVersion.Version
if minDBVersion > v {
log.Fatal(`Gitea no longer supports auto-migration from your previously installed version.
Please try to upgrade to a lower version (>= v0.6.0) first, then upgrade to current version.`)
return nil
}

@6543
Copy link
Member

6543 commented Jan 23, 2020

secound solution would be finding the bugs and fixing them ... but your idear is easyer for us devs ...

@lunny lunny added the type/enhancement An improvement of existing functionality label Jan 24, 2020
@lafriks
Copy link
Member

lafriks commented Jan 24, 2020

We could probably support migrations for last five or six major versions

@guillep2k
Copy link
Member Author

guillep2k commented Jan 24, 2020

What would you think should be the earliest version we should still support migrating from in 1.12?

  • 👎 Earlier than 1.5.3
  • 😕 1.5.3
  • 👀 1.6.x
  • 👍 1.6.4
  • 😄 1.7.x
  • 🚀 1.7.6
  • ❤️ 1.8.3

@davidsvantesson
Copy link
Contributor

There are no migration changes between 1.7.0 and 1.7.6, only one minor between 1.6.0 and 1.6.4. I think it makes sense to support from any minor version of the major version supported, as new database changes should normally be avoided in minor versions.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants