Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.3.1 #58

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion acacore/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.3.0"
__version__ = "3.3.1"
14 changes: 12 additions & 2 deletions acacore/database/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "acacore"
version = "3.3.0"
version = "3.3.1"
description = ""
authors = ["Matteo Campinoti <[email protected]>"]
license = "GPL-3.0"
Expand Down
Loading