Skip to content

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

@guillep2k

Description

@guillep2k

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions