From 824bd6fd875ef3189fec9ccc5d47aacd29033598 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Thu, 22 Aug 2024 13:24:28 +0200 Subject: [PATCH 1/4] database.upgrade:upgrade_2_0_2to3 - fix missing switch from template to ignore action --- acacore/database/upgrade.py | 1 + 1 file changed, 1 insertion(+) diff --git a/acacore/database/upgrade.py b/acacore/database/upgrade.py index a37f62d..bf98735 100644 --- a/acacore/database/upgrade.py +++ b/acacore/database/upgrade.py @@ -115,6 +115,7 @@ def convert_action_data(data: dict): conn.execute("alter table Files add column parent text") # noinspection SqlWithoutWhere conn.execute("update Files set parent = null") + conn.execute("update Files set action = 'ignore' where action = 'template'") # Reset _IdentificationWarnings view conn.execute("drop view if exists _IdentificationWarnings") From 1a0d1ee77a2db56bf839e1e70e40202d1103662a Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Thu, 22 Aug 2024 13:26:07 +0200 Subject: [PATCH 2/4] database.upgrade:upgrade_3_0_2to3_0_6 - add upgrade function for version 3.0.6 --- acacore/database/upgrade.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/acacore/database/upgrade.py b/acacore/database/upgrade.py index bf98735..4bcc1f0 100644 --- a/acacore/database/upgrade.py +++ b/acacore/database/upgrade.py @@ -149,6 +149,12 @@ def upgrade_3to3_0_2(conn: Connection) -> Version: return set_db_version(conn, Version("3.0.2")) +def upgrade_3_0_2to3_0_6(conn: Connection) -> Version: + conn.execute("update Files set action = 'ignore' where action = 'template'") + conn.commit() + return set_db_version(conn, Version("3.0.6")) + + def get_upgrade_function(current_version: Version, latest_version: Version) -> Callable[[Connection], Version]: if current_version < Version("2.0.0"): return upgrade_1to2 @@ -158,6 +164,8 @@ def get_upgrade_function(current_version: Version, latest_version: Version) -> C return upgrade_2_0_2to3 elif current_version < Version("3.0.2"): return upgrade_3to3_0_2 + elif current_version < Version("3.0.6"): + return upgrade_3_0_2to3_0_6 elif current_version < latest_version: return lambda c: set_db_version(c, Version(__version__)) else: From 3023d5b3ccec243612f9669cc6d239f10b839cac Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Thu, 22 Aug 2024 13:26:24 +0200 Subject: [PATCH 3/4] version - patch 3.0.5 > 3.0.6 --- acacore/__version__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acacore/__version__.py b/acacore/__version__.py index e94f36f..6ed0182 100644 --- a/acacore/__version__.py +++ b/acacore/__version__.py @@ -1 +1 @@ -__version__ = "3.0.5" +__version__ = "3.0.6" diff --git a/pyproject.toml b/pyproject.toml index e8d4687..04de364 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "acacore" -version = "3.0.5" +version = "3.0.6" description = "" authors = ["Matteo Campinoti "] license = "GPL-3.0" From 8912eb95b3edca079c5d357f4c4395bafb8f85cc Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Thu, 22 Aug 2024 13:28:04 +0200 Subject: [PATCH 4/4] database.upgrade:upgrade_3to3_0_2 - fix missing switch from template to ignore action --- acacore/database/upgrade.py | 1 + 1 file changed, 1 insertion(+) diff --git a/acacore/database/upgrade.py b/acacore/database/upgrade.py index 4bcc1f0..96e7ddc 100644 --- a/acacore/database/upgrade.py +++ b/acacore/database/upgrade.py @@ -140,6 +140,7 @@ def convert_action_data(data: dict): # noinspection SqlResolve def upgrade_3to3_0_2(conn: Connection) -> Version: + conn.execute("update Files set action = 'ignore' where action = 'template'") conn.execute("drop view if exists _IdentificationWarnings") conn.execute( "CREATE VIEW _IdentificationWarnings AS"