trying something to works form differents update version

This commit is contained in:
Silversthorn 2024-03-23 14:20:31 +01:00
parent 2bb8e185de
commit 9aad5e3d8f
2 changed files with 7 additions and 3 deletions

View File

@ -60,6 +60,11 @@ def migrate(migrator: Migrator, database, **kwargs):
if this_migration is not None:
Console.debug("Update database already done, skipping this part")
return
else:
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")
return
try:
logger.info("Migrating Data from Int to UUID (Foreign Keys)")

View File

@ -56,10 +56,9 @@ def migrate(migrator: Migrator, database, **kwargs):
)
# Drop Column after migration
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")
if any(column_data.name == "server_uuid" for column_data in servers_columns):
Console.debug("Servers.server_uuid not deleted before Crafty version 4.3.2, skipping this part")
migrator.drop_columns("servers", ["server_uuid"])
except Exception as ex: