mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
refactor(backend): solve copilot comments
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker
|
||||
from app.core.base import Base # Import Base z nového souboru
|
||||
from app.core.base import Base
|
||||
|
||||
DATABASE_URL = os.getenv("DATABASE_URL")
|
||||
if not DATABASE_URL:
|
||||
@@ -14,15 +14,11 @@ if not DATABASE_URL:
|
||||
else:
|
||||
raise Exception("Only MariaDB is supported. Please set the DATABASE_URL environment variable.")
|
||||
|
||||
# Explicitní import všech modelů, aby byly registrovány v Base.metadata
|
||||
# Load all models to register them
|
||||
|
||||
from app.models.user import User
|
||||
from app.models.transaction import Transaction
|
||||
|
||||
from app.models.user import User
|
||||
|
||||
# Pokud máš další modely, importuj je zde:
|
||||
# from app.models.other_model import OtherModel
|
||||
|
||||
ssl_enabled = os.getenv("MARIADB_HOST", "localhost") != "localhost"
|
||||
connect_args = {"ssl": {"ssl": True}} if ssl_enabled else {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user