Skip to content

Commit

Permalink
database.upgrade:upgrade_3_2to3_3 - set original_name for files wit…
Browse files Browse the repository at this point in the history
…hout history entries
  • Loading branch information
MatteoCampinoti94 committed Oct 29, 2024
1 parent 2751aea commit 3993040
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions acacore/database/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ def _find_original_name(uuid: str, relative_path: str) -> str:
),
)

conn.executemany(
"update Files set original_name = ? where uuid = ?",
(
(Path(relative_path).name, uuid)
for uuid, relative_path in conn.execute("select uuid, relative_path from Files where original_name = ''")
),
)

return set_db_version(conn, Version("3.3.0"))


Expand Down

0 comments on commit 3993040

Please sign in to comment.