From f1503f75fba0682ee54268e203f760c0cc551a83 Mon Sep 17 00:00:00 2001 From: Jann Stute Date: Mon, 13 Jul 2026 11:21:52 +0200 Subject: [PATCH] fix: bump db version to 300, since it is a breaking change --- .../core/library/alchemy/constants.py | 2 +- src/tagstudio/core/library/alchemy/library.py | 4 ++-- .../.TagStudio/ts_library.sqlite | Bin 122880 -> 122880 bytes 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tagstudio/core/library/alchemy/constants.py b/src/tagstudio/core/library/alchemy/constants.py index b2d42ebc..73493c9a 100644 --- a/src/tagstudio/core/library/alchemy/constants.py +++ b/src/tagstudio/core/library/alchemy/constants.py @@ -9,7 +9,7 @@ JSON_FILENAME: str = "ts_library.json" DB_VERSION_CURRENT_KEY: str = "CURRENT" DB_VERSION_INITIAL_KEY: str = "INITIAL" -DB_VERSION: int = 203 +DB_VERSION: int = 300 TAG_CHILDREN_QUERY = text(""" WITH RECURSIVE ChildTags AS ( diff --git a/src/tagstudio/core/library/alchemy/library.py b/src/tagstudio/core/library/alchemy/library.py index 11bd3529..33b6ffb6 100644 --- a/src/tagstudio/core/library/alchemy/library.py +++ b/src/tagstudio/core/library/alchemy/library.py @@ -569,7 +569,7 @@ class Library: (self.__apply_db200_migration, 200, None), # changes: field tables (self.__apply_db201_migration, 201, 200), # changes: field tables (self.__apply_db202_migration, 202, None), # changes: tag_parents - (self.__apply_db203_migration, 203, None), # changes: deletes folders + (self.__apply_db300_migration, 300, None), # changes: deletes folders ] for migration, v, iv in migrations: if loaded_db_version < v and (iv is None or initial_db_version < iv): @@ -876,7 +876,7 @@ class Library: session.flush() logger.info("[Library][Migration][202] Verified TagParent table data") - def __apply_db203_migration(self, session: Session, library_dir: Path): + def __apply_db300_migration(self, session: Session, library_dir: Path): ## remove folder_id column from entries table # create new table in the desired scheme (without folder_id column) session.execute( diff --git a/tests/fixtures/search_library/.TagStudio/ts_library.sqlite b/tests/fixtures/search_library/.TagStudio/ts_library.sqlite index 2c7c2f0ef07bdec9f3fcee03159a72210b2f319c..0cfb5bed4485b806fa87f83c1a82014ffc69cb8b 100644 GIT binary patch delta 1340 zcmZvaT}V@57{}iy_i^^UIh}52r?vbX`3Z%1A!JcuwnkvsSYvE@SjL)bZj{o627TC# zby2SukwPF9q0k2-=%TJR=f}JXOhvl$E+WB;C_3*s%X3Z&yV!Vs`~UyX|9wV3sYkib zJNPki02(qsC!pS3a^L9B9Gr%)inng_XUKe*0Y(LPxgWOyv$N2mNxRh*G!1t;@v~X@ zjYsCdka;=>1Ll)T3o^YoT{e{%Ul_ecWO#1q(eLOd_3gSX9oC)J?r0~q?V2skJW}J6s%_OnRf96899N!IS~#D1g{iHULM|&poi6rTA~lS^<-l#_zcwY}(T*Al z)sSfornBI&rQ@k^G|Kk#v+CX1dD$#=GZm?#P>}qu4Uc8vlq(tP8%XxW*ibSwbUhtT zvP2+qSPD7u)EemV%PcS=J}AZAa(r&meEKXYS zqfM~ksSQwL&pgyS2b1A=lnt@5*g#^4PamWy6d)@$3+%``STLOjhK?p#HZDa24hs1R z+9;qco1nn2*12s9^T0SFv9wItZ>LZ%!H*E!fz5fSwbe+LGh0lPJu{!trY4e&Mv`uVFNUHZ2=hT(3Nn4ui01nU$_m>;wL$5ma6BRq&EPz|hsgTSwD`5T$b!eNgtYXz52)ap||F~0HODJwd5jUb1e3R741clk$bM8C$<4o?YnB(7b_%`21 zs)g_K5U}+>P|}6Hi?D98WUnV@rjl1O$!t2i;FSq-Rn}aT!$JPk16Vu_!Kj!<%b z$7z8Rw@W0dX2;k7E?4BK_*aTSiTuuY%&H5V#14Z&(W