Skip to content

Commit

Permalink
Merge pull request #44
Browse files Browse the repository at this point in the history
v3.0.6
  • Loading branch information
MatteoCampinoti94 authored Aug 22, 2024
2 parents b766207 + 8912eb9 commit 6751790
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
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

0 comments on commit 6751790

Please sign in to comment.