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

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

Open
talalhussain-10p opened this issue Oct 10, 2023 · 0 comments

Comments

@talalhussain-10p
Copy link

talalhussain-10p commented Oct 10, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant