|L i8ddlZddlmZddlZddlmZddlmZddlmZdZ ejZ e jee jejdZ e jdd ZiZd d Zd d Zej&reyey) N) fileConfig)engine_from_config)pool)contextFz alembic.env databasesc Xi}tjdtD],}ix||<}tjj |d|d<.|j D]\}}tjd|zd|z}tjd|zt|d5}tj|d|tj|dd d i tj5tj| d d d d d d y #1swYxYw#1swYxYw)aFRun migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine creation we don't even need a DBAPI to be available. Calls to context.execute() here emit the given string to the script output. ,\s*zsqlalchemy.urlurlMigrating database %sz%s.sqlzWriting output to %swT paramstylenamed)r output_buffertarget_metadata literal_binds dialect_opts engine_nameN)resplitdb_namesrconfigget_section_optionitemsloggerinfoopen configurergetbegin_transactionrun_migrations)enginesnamerecfile_buffers c/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/alembic/templates/multidb/env.pyrun_migrations_offliner).sG(+O   ^^66t=MNE O]]_ 9 c +d234 *U23 %  9   J$ / 3 3D 9"*G4  **, 9&&48 9 9 9 9 9 9 9 9s%#AD *DD D D  D) c 8i}tjdtD]F}ix||<}ttj j |idtj|d<H|jD]L\}}|d}|jx|d<}tr|j|d<:|j|d<N |jD]h\}}tjd|zt j |dd|zd |zt"j%| t j&| jtr(|j)D]}|dj+|j)D]}|dj- |j)D]}|dj1y #|j)D]}|dj/xYw#|j)D]}|dj1wxYw) zRun migrations in 'online' mode. In this scenario we need to create an Engine and associate a connection with the context. r z sqlalchemy.)prefix poolclassengine connection transactionr z %s_upgradesz %s_downgrades)r. upgrade_tokendowngrade_tokenrrN)rrrrrr get_sectionrNullPoolrconnect USE_TWOPHASEbegin_twophasebeginrrrrr r"valuespreparecommitrollbackclose)r#r$r%r-conns r(run_migrations_onliner>RsG(+    * NN & &tR 0 mm H  ]]_. cX#)>>#33LD !%!4!4!6C !%C .&  5ID# KK/$6 7   |,+d2 /$ 6 / 3 3D 9    " "t 4 5 ~~' -M"**, ->># (C   % % ' (>># &C   # # % & >># *C   ' ' ) * >># &C   # # % &sCG+G,,G//*H)returnN)logginglogging.configrr sqlalchemyrralembicrr5rconfig_file_name getLoggerrget_main_optionrrr)r>is_offline_moder(rJs% )   &v&&'   = )  ! !+r 2!9H4&n7rI