From 44557cef13c6a966d85ae80592c56be2683c1767 Mon Sep 17 00:00:00 2001 From: gred Date: Mon, 28 Oct 2024 16:44:37 +0300 Subject: [PATCH] Change imports in alembic.ini\nApply init migration to alembic_current\nRemove auto creation of migration file --- alembic.ini | 6 +++--- tagstudio/src/core/library/alchemy/library.py | 1 - .../library/alembic/alembic_current.sqlite | Bin 12288 -> 98304 bytes 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/alembic.ini b/alembic.ini index 907de9a8b..e5f30f7cf 100644 --- a/alembic.ini +++ b/alembic.ini @@ -3,7 +3,7 @@ [alembic] # path to migration scripts # Use forward slashes (/) also on windows to provide an os agnostic path -script_location = src/core/library/alembic/migrations +script_location = tagstudio/src/core/library/alembic/migrations # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s # Uncomment the line below if you want the files to be prepended with date and time @@ -13,7 +13,7 @@ script_location = src/core/library/alembic/migrations # sys.path path, will be prepended to sys.path if present. # defaults to the current working directory. -prepend_sys_path = . +prepend_sys_path = . tagstudio # timezone to use when rendering the date within the migration file # as well as the filename. @@ -61,7 +61,7 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne # are written from script.py.mako # output_encoding = utf-8 -sqlalchemy.url = sqlite:///./src/core/library/alembic/alembic_current.sqlite +sqlalchemy.url = sqlite:///./tagstudio/src/core/library/alembic/alembic_current.sqlite [post_write_hooks] diff --git a/tagstudio/src/core/library/alchemy/library.py b/tagstudio/src/core/library/alchemy/library.py index 24debdd00..91f76be05 100644 --- a/tagstudio/src/core/library/alchemy/library.py +++ b/tagstudio/src/core/library/alchemy/library.py @@ -145,7 +145,6 @@ def migrate(self, db_url: str): alembic_cfg = Config("alembic.ini") alembic_cfg.set_main_option("sqlalchemy.url", db_url) command.stamp(alembic_cfg, "head") - command.revision(alembic_cfg, autogenerate=True) command.upgrade(alembic_cfg, "head") def open_library(self, library_dir: Path, storage_path: str | None = None) -> LibraryStatus: diff --git a/tagstudio/src/core/library/alembic/alembic_current.sqlite b/tagstudio/src/core/library/alembic/alembic_current.sqlite index 969649a60a0791247a705ae67d3322b43f31f78d..634e5c84eb77cfa288eac73c66bd8dc238164257 100644 GIT binary patch literal 98304 zcmeI)&u`Oa7{KwkrAeETgkQx-y%-Q85oIG3G!Q~t=nND}Leq2;(j?1moYf*t+QdPH zTMEZr_)B)1wA+6E8@uhk+ct^A{5p1=H^d!h^R1}z+OO^U`Ml5jzJBG1jrBF#v9w0J zvuirqa^gfnQ4(KhS|X9iy1(b#-{2?X7LElQ?x!+Rjw)sopS;@7JGFb@r#^iXI?v-#<8; zQqP}PUf*%dt)}Ie-x>|uYSz19NnNSxrJAnQO83@uE!?l=({tXjhF#ZI%QgLhUe(H# znpWOiTU*l7bK=m5s;AY}C#C8$?Xmt$%Lf-(@-A-I3*zMam8!n_pe&9U9#GJ#`hC5s zmsj)+@7S&Ofq%PNe!_W!8yG*U>m8deEUQWN!FeTNx9ZkGcfaW-reXG+wzqABaT>+2 zeD3hpLQ1`OQF-&(z{@&t0BFRrM3$84wiJi7JfE#a|;69}jydVuxrR6WUL0l-L3y0Uv zq|`z|d9yf7wXppJak#Z014?zm@S`F7@^nhQaz%Obxkpwv9m}zIEkEPNHqS_CW0fCw z<~=$!$h?ZjxYceqEwkk-%3G%;M7b_ByjQ8L>7}yNB|ny&?7uqUjesLFMz^=+_Fr$x z@QWuUM$x(b3SqcscH99aYV_LPv77a%N@?^OUS~-QPI_o;9h1kh;T5I9OvL8T z88=TR)zynf%^7~2gGs~RIMsic^UMyv9u9qG(>A-7XXY1Ayl3WD95Ldx%-!K!B4wi> zkH|>LaKa2QI5kS3zn@8|i;K$Z+g>RC%;0}yr4WX*M&y9qXgBLtC+bG`OlN1}?APrz z8ur1&s{ada_!p)427AMt*etKEZ|YiJ+<`lDUCk!d(qdGr`(YYIzmV&HGe3Byn)Zmo zxiBmpm!QJ^qN%<4a$<1Ntt}>6|B)hpyC7wP-8Je~!|XL3ZPKvy;SUSJJidJVsOP3I z7NZ!JGf&e=F_As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