From 5e4dbb1902c93f0ab1051ccfeaaf266f52c34e38 Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Sat, 23 Mar 2024 12:28:22 +0100 Subject: [PATCH] Disabling code if already updated to prevent unnecessary errors messages --- app/migrations/20240216_rework_servers_uuid_part2.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/migrations/20240216_rework_servers_uuid_part2.py b/app/migrations/20240216_rework_servers_uuid_part2.py index 58f2ebb8..a3e30cd8 100644 --- a/app/migrations/20240216_rework_servers_uuid_part2.py +++ b/app/migrations/20240216_rework_servers_uuid_part2.py @@ -22,12 +22,10 @@ def migrate(migrator: Migrator, database, **kwargs): """ db = database - this_migration = MigrateHistory.get(MigrateHistory.name == "20240216_rework_servers_uuid_part2") - if this_migration: - Console.debug("Update database already done, skipping this migration") + this_migration = MigrateHistory.get_or_none(MigrateHistory.name == "20240216_rework_servers_uuid_part2") + if this_migration is not None: + Console.debug("Update database already done, skipping this part") return - else : - Console.debug("Update database not done, doing : Migration Data from Int to UUID") # ********************************************************************************** # Servers New Model from Old (easier to migrate without dunmping Database)