e25fd86171
Deploy / Staging E2E Tests (push) Has been skipped
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
Deploy / Deploy Staging (push) Failing after 137h58m6s
CI/CD Pipeline / Frontend Lint (push) Failing after 137h58m12s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 137h58m12s
21 lines
717 B
Python
21 lines
717 B
Python
from app.config import settings
|
|
|
|
from packages.adapters.sqlalchemy_impl import (
|
|
build_session_factory,
|
|
ensure_database_exists,
|
|
initialize_database,
|
|
)
|
|
from packages.adapters.sqlalchemy_impl.schema_guard import assert_auto_create_schema_allowed
|
|
|
|
ensure_database_exists(settings.DATABASE_URL)
|
|
engine, SessionLocal = build_session_factory(
|
|
settings.DATABASE_URL,
|
|
pool_size=settings.DATABASE_POOL_SIZE,
|
|
max_overflow=settings.DATABASE_MAX_OVERFLOW,
|
|
pool_timeout=settings.DATABASE_POOL_TIMEOUT,
|
|
pool_recycle=settings.DATABASE_POOL_RECYCLE,
|
|
)
|
|
assert_auto_create_schema_allowed(settings.ENVIRONMENT, settings.AUTO_CREATE_SCHEMA)
|
|
if settings.AUTO_CREATE_SCHEMA:
|
|
initialize_database(engine)
|