This commit is contained in:
2026-03-12 12:32:29 +08:00
parent c0f9ddabbf
commit 470446fa6f
18 changed files with 591 additions and 142 deletions

View File

@@ -1,8 +1,16 @@
from logging.config import fileConfig
import sys
from pathlib import Path
from sqlalchemy import engine_from_config, pool
from alembic import context
# Ensure `backend/` is on sys.path so `import app...` works
# no matter where `alembic` is executed from.
BACKEND_ROOT = Path(__file__).resolve().parents[1]
if str(BACKEND_ROOT) not in sys.path:
sys.path.insert(0, str(BACKEND_ROOT))
from app.core.config import settings
from app.core.database import Base
import app.models # noqa: F401 ensure all models are imported