Skip to content

Ability to properly backroll migration jobs#1062

Merged
Toastbrot236 merged 11 commits intoLittleBigRefresh:mainfrom
Toastbrot236:w-clear
Apr 1, 2026
Merged

Ability to properly backroll migration jobs#1062
Toastbrot236 merged 11 commits intoLittleBigRefresh:mainfrom
Toastbrot236:w-clear

Conversation

@Toastbrot236
Copy link
Copy Markdown
Contributor

Makes the WorkerManager automatically remove job states from DB if the manager doesn't have a matching job class, as long as the state belongs to a Refresh-class job. This way, if an instance admin wants to backroll their instance to a Refresh version which doesn't have a certain migration job (which was previously already executed due to them running the newer version first), and then they want to update their instance again, the new job will migrate all entities again, which means that it'll also catch all entities uploaded or updated after the rollback, but before the update.

This does mean that such jobs could try to migrate already migrated entities, however the jobs themselves should have to ensure that no issues will happen because of that, e.g. by simply skipping entities which don't need a migration (TODO until next release).

This also adds a few workarounds to weird test-exclusive issues I've found when writing unit tests for this, where EF would reasonlessly try to also insert the user and their stats when trying to insert a different entity (GameLevel or Event mostly) into the database, while having their user reference set.

@Toastbrot236 Toastbrot236 merged commit b19ac23 into LittleBigRefresh:main Apr 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants