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

Fix extra unreferenced tags been created #1807

Merged

Conversation

toshski
Copy link
Contributor

@toshski toshski commented Jul 29, 2024

Fixes #1707

Fixes an issue where duplicate Tags are been created during scene scrapping but are not referenced by any scenes.

Includes a migration to remove unreferenced tags, i.e. where the count column in the tag = 0. If Tag records with the count of 0 exists and should be deleted but is referenced in the scene_tags table, it will not delete the unreferenced tags. This should not happen but is just a precaution, so a data referential integrity issue is not created.

I have updated the migration logic to allow a migration to be flagged to retry. This is useful where the migration is not required for the new version of Xbvr to run, e.g. the unreferenced tags are not causing an issue other than creating unused entries in the tags table. Another, example where this could be useful would be adding an index, adding the index would make the system faster but if the migration failed create the index, the new version would still run. Retriable migrations would not be the norm. To flag a migration to retry, you can add the Migration Id to the retryMigration array and return nil from the migration function. The Id will be removed from the migrations table so it tries again the next time xbvr runs.

@crwxaj crwxaj merged commit 80c7a82 into xbapps:master Aug 5, 2024
1 check 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
Development

Successfully merging this pull request may close these issues.

Database: Thousands of tags with same name and count 0 in table tags
2 participants