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: use uuid instead of numbers to identify migration steps #8613

Open
guillep2k opened this issue Oct 21, 2019 · 0 comments
Open

Proposal: use uuid instead of numbers to identify migration steps #8613

guillep2k opened this issue Oct 21, 2019 · 0 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@guillep2k
Copy link
Member

Migrations could have a uuid instead of a number, and the 'version' table should just have the list of migrations already done. The order in which the migrations are performed is important, of course, but that is already determined by the order of the migrations slice in migrations.go.

So, backporting a migration or merging a PR into master will hardly ever produce a conflict except when one migration is dependent of another (but even that case can be covered, for instance):

func NewMigration(desc string, fn func(*xorm.Engine) error, uuid string, dependsOn []string) Migration {
}

If a migration signals another as a dependency and that one migration was not yet merged (e.g. when backporting), the integration tests will simply fail.

@guillep2k guillep2k changed the title Proposal: a new kind of migration version check Proposal: use uuid instead of numbers to identify migration steps Oct 21, 2019
@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants