Skip to content
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

Proposal: backport migration #10625

Closed

Conversation

guillep2k
Copy link
Member

I've created a pattern to support backporting certain migrations. As an example, I've backported #10617.

Important: This PR is not pointing to master but release/v1.11

I've labeled this PR kind/proposal for the system and kind/bug for the migration I've included.

@guillep2k guillep2k added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Mar 6, 2020
@guillep2k guillep2k added this to the 1.11.2 milestone Mar 6, 2020
@lunny
Copy link
Member

lunny commented Mar 6, 2020

But then the same migrations may be executed twice?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 6, 2020
@guillep2k
Copy link
Member Author

But then the same migrations may be executed twice?

Yes, that's a requisite. Only migrations that can be executed twice, like the one backported here. I've wrote it down right before the declaration, just in case:

// Backports are only applied after latest version in 'migrations'.
// This list must be **empty** in master, but can contain items in release branches.
// Backported migrations must conform to the following criteria:
//    * The function must support being executed multiple times (e.g. when updating to the next
//      minor revision and when the actual migration is executed again on the next major upgrade).
//    * The function must not rely on data structures that might not be present in the branch
//      it is backported to, unless its safe that it will add the column itself.

@6543
Copy link
Member

6543 commented Mar 6, 2020

Not bad but the 117.1.go is a weared naming concept. Why not name bakports like bachport_<number>.go?

@guillep2k
Copy link
Member Author

Not bad but the 117.1.go is a weared naming concept. Why not name bakports like bachport_<number>.go?

I wanted it to follow the version/subversion number in the version table.

@lunny lunny modified the milestones: 1.11.3, 1.11.4 Mar 10, 2020
@techknowlogick
Copy link
Member

We could also use a tool such as xormigrate which keeps track of all the migrations that are run, instead of just the latest, and would be able to handle the case of backporting a migration.

@lafriks lafriks modified the milestones: 1.11.4, 1.11.5 Apr 1, 2020
@lunny lunny modified the milestones: 1.11.5, 1.11.6 May 1, 2020
@techknowlogick techknowlogick modified the milestones: 1.11.6, 1.11.7 Jun 3, 2020
@lafriks lafriks modified the milestones: 1.11.7, 1.12.1, 1.12.2 Jun 18, 2020
@lafriks lafriks modified the milestones: 1.12.2, 1.12.3 Jul 11, 2020
@techknowlogick techknowlogick modified the milestones: 1.12.3, 1.12.4 Jul 28, 2020
@lunny lunny removed this from the 1.12.4 milestone Sep 4, 2020
@lunny lunny added this to the 1.12.5 milestone Sep 4, 2020
@lunny lunny modified the milestones: 1.12.5, 1.x.x Sep 18, 2020
@lunny lunny removed this from the 1.x.x milestone Mar 20, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants