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

Check each previously run migration before attempting to rerun #1328

Merged
merged 1 commit into from Aug 21, 2023

Conversation

Layoric
Copy link
Member

@Layoric Layoric commented Aug 21, 2023

Check each previously run migration to avoid the issue where multiple developers are working on the same shared development environment. Issue relates to the assumption that migration classes would not be deleted. If accidentally done, all previous migrations will attempt to be rerun. This was caused by only ever checking the last run migration via the .Limit(1) at the end of the query.

This change selects all rows in Migration to check against each known migrationType to validate if it needs to be rerun or not. Optionally, we could optimize to the last N migrations like 5 as this would be very unlikely to hit the same issue but I guess still possible.

Related to raised issue in customer forums

… developers are working on the same shared development environment. Issue relates to the assumption that migration classes would not be deleted. If accidentally done, all previous migrations will attempt to be rerun.
@mythz mythz merged commit 66a26eb into main Aug 21, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants