diff --git a/backend/alembic/README b/backend/alembic/README deleted file mode 100644 index 98e4f9c..0000000 --- a/backend/alembic/README +++ /dev/null @@ -1 +0,0 @@ -Generic single-database configuration. \ No newline at end of file diff --git a/backend/alembic/env.py b/backend/alembic/env.py index bc7373f..5abb36a 100644 --- a/backend/alembic/env.py +++ b/backend/alembic/env.py @@ -4,7 +4,7 @@ from logging.config import fileConfig from sqlalchemy import pool, create_engine from alembic import context -# Přidání backend do sys.path pro správný import +# Add path for correct loading of modules sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from app.core.db import Base @@ -16,7 +16,6 @@ target_metadata = Base.metadata DATABASE_URL = os.getenv("DATABASE_URL") if not DATABASE_URL: - # fallback na synchronní url pro Alembic (používá sync driver) mariadb_host = os.getenv("MARIADB_HOST", "localhost") mariadb_port = os.getenv("MARIADB_PORT", "3306") mariadb_db = os.getenv("MARIADB_DB", "group_project") @@ -24,7 +23,7 @@ if not DATABASE_URL: mariadb_password = os.getenv("MARIADB_PASSWORD", "strongpassword") DATABASE_URL = f"mysql+pymysql://{mariadb_user}:{mariadb_password}@{mariadb_host}:{mariadb_port}/{mariadb_db}" -# Vždy používej synchronní engine pro migrace +# Use synchronous driver for Alembic migrations SYNC_DATABASE_URL = DATABASE_URL.replace("+asyncmy", "+pymysql")