From f3550ca817a87bb11d5577cc3555f3740ebf7aa0 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 2 Jan 2025 14:35:01 -0500 Subject: [PATCH 1/2] Fix backup migration running twice. --- app/migrations/20240308_multi-backup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/migrations/20240308_multi-backup.py b/app/migrations/20240308_multi-backup.py index 64ff03e1..f8bd7439 100644 --- a/app/migrations/20240308_multi-backup.py +++ b/app/migrations/20240308_multi-backup.py @@ -8,7 +8,7 @@ import logging from app.classes.shared.helpers import Helpers from app.classes.shared.console import Console -from app.classes.shared.migration import Migrator +from app.classes.shared.migration import Migrator, MigrateHistory from app.classes.shared.file_helpers import FileHelpers logger = logging.getLogger(__name__) @@ -25,6 +25,12 @@ def migrate(migrator: Migrator, database, **kwargs): """ Write your migrations here. """ + this_migration = MigrateHistory.get_or_none( + MigrateHistory.name == "20240308_multi-backup" + ) + if this_migration is not None: + Console.debug("Update database already done, skipping this part") + return backup_migration_status = True schedule_migration_status = True db = database From 132ca0b9e2597134ec9466057873767980ee22aa Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 19 Jan 2025 19:53:35 +0000 Subject: [PATCH 2/2] Update changelog !820 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88c9ad31..e9f1cc4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ TBD ### Bug fixes - Bump requests to resolve yank for CVE-2024-35195 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/808)) - Better handle malformed mcping data ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/799)) -- Resolves type issue when posting no keywords in the "keyword" field in config.json tab ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/819)) +- Resolve type issue when posting no keywords in the "keyword" field in config.json tab ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/819)) +- Resolve issue where sometimes backup migration `20240308_multi-backup` would run twice ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/820)) ### Tweaks - Dyamically change child action translation for backups ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/806)) - Remove EXIF image data on app Background Photos ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/805))