Checking if the column is already deleted

This commit is contained in:
Silversthorn 2024-03-23 14:13:45 +01:00
parent f71aaeb870
commit 2bb8e185de

View File

@ -56,7 +56,11 @@ def migrate(migrator: Migrator, database, **kwargs):
) )
# Drop Column after migration # Drop Column after migration
migrator.drop_columns("servers", ["server_uuid"])
servers_columns = db.get_columns('servers')
if not any(column_data.name == "server_uuid" for column_data in servers_columns):
Console.debug("Servers.server_uuid already deleted in Crafty version 4.3.0, skipping this part")
migrator.drop_columns("servers", ["server_uuid"])
except Exception as ex: except Exception as ex:
logger.error("Error while migrating Data from Int to UUID (Fixing Issue)") logger.error("Error while migrating Data from Int to UUID (Fixing Issue)")