Fix upgrade issues from 1.5 to 1.6

This commit is contained in:
Théophile Diot 2024-10-28 12:22:32 +01:00
parent 892ca65552
commit aa46ba62d2
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -1222,6 +1222,9 @@ class Database:
# ? As the external column has been replaced by the type column, we need to update the data if the column exists
if table_name == "bw_plugins" and external_column is not None:
row["type"] = "external" if external_column else "core"
elif table_name in ("bw_services", "bw_instances") and "creation_date" not in row:
row["creation_date"] = datetime.now().astimezone()
row["last_update" if table_name == "bw_services" else "last_seen"] = datetime.now().astimezone()
with self._db_session() as session:
try: