Skip to content

Commit 8369738

Browse files
committed
feat: log start and end of DB migrations
1 parent 81734c1 commit 8369738

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/tagstudio/core/library/alchemy/library.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,14 @@ def open_sqlite_library(
586586
]
587587
for migration, v, iv in migrations:
588588
if loaded_db_version < v and (iv is None or initial_db_version < iv):
589+
logger.info(f"[Library][Migration][{v}] Starting DB Migration")
589590
with session:
590591
# any error causes transaction to rollback
591592
migration(session, library_dir)
592593
loaded_db_version = v
593594
self.set_version(session, DB_VERSION_CURRENT_KEY, v)
594595
session.commit()
596+
logger.info(f"[Library][Migration][{v}] Completed DB Migration")
595597

596598
assert loaded_db_version == DB_VERSION, (
597599
"Ran all migrations, but the DB is still not on the newest version"

0 commit comments

Comments
 (0)