From 119e59fefd2e42aaa3850dbee75fcf9f443aaf2e Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 20 Aug 2024 09:39:51 +0200 Subject: [PATCH] database.upgrade:upgrade_2_0_2to3 - add `_IdentificationWarnings` reset --- acacore/database/upgrade.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/acacore/database/upgrade.py b/acacore/database/upgrade.py index de7f462..2293e6e 100644 --- a/acacore/database/upgrade.py +++ b/acacore/database/upgrade.py @@ -131,6 +131,13 @@ def convert_action_data(data: dict): # noinspection SqlWithoutWhere conn.execute("update Files set parent = null") + # Reset _IdentificationWarnings view + conn.execute("drop view if exists _IdentificationWarnings") + conn.execute( + "CREATE VIEW _IdentificationWarnings AS" + ' SELECT * FROM Files WHERE "Files".warning is not null or "Files".puid is NULL;' + ) + cursor = conn.execute("select * from Files where action_data != '{}'") cursor.row_factory = Row