Skip to content

Commit

Permalink
Merge pull request #36
Browse files Browse the repository at this point in the history
v2.0.1
  • Loading branch information
MatteoCampinoti94 authored Aug 5, 2024
2 parents b99d8f8 + 3e9d1a5 commit 944d06e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion acacore/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0"
__version__ = "2.0.1"
3 changes: 2 additions & 1 deletion acacore/database/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def get_upgrade_function(current_version: Version, latest_version: Version) -> C

# noinspection SqlResolve
def upgrade_1to2(db: FileDB) -> Version:
db.execute("alter table Files add column lock boolean default false")
if not db.execute("select 1 from pragma_table_info('Files') where name = 'lock'").fetchone():
db.execute("alter table Files add column lock boolean default false")
db.execute("update Files set lock = false where lock is null")
db.execute("update Files set action = 'template' where action = 'replace'")
for file in db.files.select():
Expand Down
2 changes: 1 addition & 1 deletion acacore/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class File(BaseModel):
root: Path | None = DBField(None, ignore=True)

# noinspection PyNestedDecorators
@field_validator("action_data")
@field_validator("action_data", mode="before")
@classmethod
def _validate_action_data(cls, v: None | dict) -> dict:
return {} if v is None else v
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 = "2.0.0"
version = "2.0.1"
description = ""
authors = ["Matteo Campinoti <[email protected]>"]
license = "GPL-3.0"
Expand Down

0 comments on commit 944d06e

Please sign in to comment.