From 03af4a4960fa99475b36ed2d8e50e1fd0d276d95 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 29 Oct 2024 12:43:16 +0100 Subject: [PATCH 1/3] version - patch 3.3.0 > 3.3.1 --- 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 88c513e..ff04168 100644 --- a/acacore/__version__.py +++ b/acacore/__version__.py @@ -1 +1 @@ -__version__ = "3.3.0" +__version__ = "3.3.1" diff --git a/pyproject.toml b/pyproject.toml index f59e5b4..fbb484a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "acacore" -version = "3.3.0" +version = "3.3.1" description = "" authors = ["Matteo Campinoti "] license = "GPL-3.0" From e3030fbd134da0928891af043fec173839a9da68 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 29 Oct 2024 12:43:48 +0100 Subject: [PATCH 2/3] database.upgrade:upgrade_3_3to3_3_1 - add function to fix incorrect column name in previous version of `upgrade_3_2to3_3` --- acacore/database/upgrade.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/acacore/database/upgrade.py b/acacore/database/upgrade.py index a2e34f4..f866436 100644 --- a/acacore/database/upgrade.py +++ b/acacore/database/upgrade.py @@ -284,6 +284,14 @@ def _find_original_name(uuid: str, relative_path: str) -> str: return set_db_version(conn, Version("3.3.0")) +# noinspection SqlResolve +def upgrade_3_3to3_3_1(conn: Connection) -> Version: + if conn.execute("select 1 from pragma_table_info('Files') where name = 'processed_name'").fetchone(): + conn.execute("alter table Files rename column processed_name to processed_names") + + return set_db_version(conn, Version("3.3.1")) + + def get_upgrade_function(current_version: Version, latest_version: Version) -> Callable[[Connection], Version]: if current_version < Version("2.0.0"): return upgrade_1to2 @@ -301,6 +309,8 @@ def get_upgrade_function(current_version: Version, latest_version: Version) -> C return upgrade_3_1to3_2 elif current_version < Version("3.3.0"): return upgrade_3_2to3_3 + elif current_version < Version("3.3.1"): + return upgrade_3_3to3_3_1 elif current_version < latest_version: return lambda c: set_db_version(c, Version(__version__)) else: From 766910ef70636bc46eacd75df868bf6102e8fec7 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 29 Oct 2024 12:44:00 +0100 Subject: [PATCH 3/3] database.upgrade:upgrade_3_2to3_3 - fix incorrect column name --- acacore/database/upgrade.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acacore/database/upgrade.py b/acacore/database/upgrade.py index f866436..9d9b584 100644 --- a/acacore/database/upgrade.py +++ b/acacore/database/upgrade.py @@ -219,8 +219,8 @@ def convert_action_data(data: dict) -> dict: def upgrade_3_2to3_3(conn: Connection) -> Version: if not conn.execute("select 1 from pragma_table_info('Files') where name = 'original_name'").fetchone(): conn.execute("alter table Files add column original_name text not null default ''") - if not conn.execute("select 1 from pragma_table_info('Files') where name = 'processed_name'").fetchone(): - conn.execute("alter table Files add column processed_name text default '[]'") + if not conn.execute("select 1 from pragma_table_info('Files') where name = 'processed_names'").fetchone(): + conn.execute("alter table Files add column processed_names text default '[]'") def _find_original_name(uuid: str, relative_path: str) -> str: original_path: Path = Path(relative_path)