fix: Update Alembic configuration in startup event to set script location and database URL
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m26s

This commit is contained in:
mohamad 2025-06-01 16:57:07 +02:00
parent 411c3c91b2
commit f2df1c50dd

View File

@ -223,7 +223,9 @@ async def startup_event():
# Run database migrations
try:
logger.info("Running database migrations...")
alembic_cfg = Config("alembic.ini")
alembic_cfg = Config()
alembic_cfg.set_main_option("script_location", "alembic")
alembic_cfg.set_main_option("sqlalchemy.url", settings.DATABASE_URL)
command.upgrade(alembic_cfg, "head")
logger.info("Database migrations completed successfully.")
except Exception as e: