Skip to content

Incorrect Migration Number When Downgrading from a High Version to an Atomic One. #111

@talalhussain-10p

Description

@talalhussain-10p

@vmihailenco, need your input on this issue.

Imagine you have a set of migrations. Let's say the last migration you performed was number 148. Now, you decided to add a new migration using a timestamp-based version such as 20231010072528. When you up the migration it is working perfectly.

Here's the issue:
When you want to "down" a migration, you'd expect to go back to the previous version, which should be 148 in this case. However, what's happening currently is that instead of going back to 148, the system is subtracting 1 from 20231010072528 and taking you to 20231010072527. This behavior doesn't match the expectations.

migrations.Run() function should return the correct previous version, which in this case should be 148, rather than the unexpected 20231010072527.

Note: Migration is getting down as expected but version number is not correct.

Code sample which reproduces the issue:
go-pg-migration-issue.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions