mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-07-08 07:04:44 +02:00
fix(db migration 9): filename property wasn't written correctly
This commit is contained in:
@@ -598,6 +598,8 @@ class Library:
|
||||
logger.info(f"[Library] Library migrated to DB version {DB_VERSION}")
|
||||
|
||||
# check if folder matching current path exists already
|
||||
# NOTE: this has been causing new Folders to be created when the library is moved, since
|
||||
# its introduction
|
||||
self.folder = session.scalar(select(Folder).where(Folder.path == library_dir))
|
||||
if not self.folder:
|
||||
folder = Folder(
|
||||
@@ -686,7 +688,8 @@ class Library:
|
||||
|
||||
# Populate the new filename column.
|
||||
for entry in self.__all_entries(session):
|
||||
session.merge(entry).filename = entry.path.name
|
||||
entry.filename = entry.path.name
|
||||
session.merge(entry)
|
||||
session.flush()
|
||||
logger.info("[Library][Migration][9] Populated filename column in entries table")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user