From d755d57abc42da389f270c61a270e99439399a04 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 29 Oct 2024 07:51:47 +0100 Subject: [PATCH] models.file:File.processed_name - rename to processed_names and turn into a list --- acacore/database/upgrade.py | 2 +- acacore/models/file.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acacore/database/upgrade.py b/acacore/database/upgrade.py index c9cedeb..a2e34f4 100644 --- a/acacore/database/upgrade.py +++ b/acacore/database/upgrade.py @@ -220,7 +220,7 @@ 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 null") + conn.execute("alter table Files add column processed_name text default '[]'") def _find_original_name(uuid: str, relative_path: str) -> str: original_path: Path = Path(relative_path) diff --git a/acacore/models/file.py b/acacore/models/file.py index 737d1be..9675651 100644 --- a/acacore/models/file.py +++ b/acacore/models/file.py @@ -91,7 +91,7 @@ class File(BaseModel): processed: bool = False lock: bool = False original_name: str - processed_name: str | None = None + processed_names: list[str] = Field(default_factory=list) root: Path | None = DBField(None, ignore=True) # noinspection PyNestedDecorators