diff --git a/deps/test-task-2025-06-30-v1/python/online/fxreader/pr34/test_task_2025_06_30_v1/tickers/alembic/env.py b/deps/test-task-2025-06-30-v1/python/online/fxreader/pr34/test_task_2025_06_30_v1/tickers/alembic/env.py index 85b8cd8..fa6a5a9 100644 --- a/deps/test-task-2025-06-30-v1/python/online/fxreader/pr34/test_task_2025_06_30_v1/tickers/alembic/env.py +++ b/deps/test-task-2025-06-30-v1/python/online/fxreader/pr34/test_task_2025_06_30_v1/tickers/alembic/env.py @@ -18,7 +18,10 @@ if config.config_file_name is not None: # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata -target_metadata = None +# target_metadata = None +from online.fxreader.pr34.test_task_2025_06_30_v1.tickers.settings import Settings +from online.fxreader.pr34.test_task_2025_06_30_v1.tickers.models import Base +target_metadata = Base.metadata # other values from the config, defined by the needs of env.py, # can be acquired: @@ -27,7 +30,6 @@ target_metadata = None def run_migrations_offline() -> None: - from online.fxreader.pr34.test_task_2025_06_30_v1.tickers.settings import Settings """Run migrations in 'offline' mode. @@ -61,10 +63,16 @@ def run_migrations_online() -> None: and associate a connection with the context. """ + + url = Settings.singleton().db_url + connectable = engine_from_config( - config.get_section(config.config_ini_section, {}), + config.get_section( + config.config_ini_section, {} + ), prefix="sqlalchemy.", poolclass=pool.NullPool, + url=url, ) with connectable.connect() as connection: