Prepared for production

This commit is contained in:
2026-04-23 13:54:53 +03:00
parent 09fecdae31
commit f221aebef0
8 changed files with 159 additions and 118 deletions

View File

@@ -14,6 +14,7 @@ from iaai_scraper.core.config import Settings
from iaai_scraper.storage.models import Base
config = context.config
VERSION_TABLE = "iaai_parser_alembic_version"
# Logging
if config.config_file_name is not None:
@@ -32,6 +33,7 @@ def run_migrations_offline() -> None:
context.configure(
url=url,
target_metadata=target_metadata,
version_table=VERSION_TABLE,
literal_binds=True,
dialect_opts={"paramstyle": "named"},
)
@@ -47,7 +49,11 @@ def run_migrations_online() -> None:
poolclass=pool.NullPool,
)
with connectable.connect() as connection:
context.configure(connection=connection, target_metadata=target_metadata)
context.configure(
connection=connection,
target_metadata=target_metadata,
version_table=VERSION_TABLE,
)
with context.begin_transaction():
context.run_migrations()