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.0.6 #44

Merged
merged 4 commits into from
Aug 22, 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.0.5"
__version__ = "3.0.6"
10 changes: 10 additions & 0 deletions acacore/database/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -139,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"
Expand All @@ -148,6 +150,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
Expand All @@ -157,6 +165,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:
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.0.5"
version = "3.0.6"
description = ""
authors = ["Matteo Campinoti <[email protected]>"]
license = "GPL-3.0"
Expand Down
Loading