mirror of
https://git.victorphan.net/basketballcantho/ten-project.git
synced 2026-08-05 14:33:10 +07:00
hoàn thành bước tạo docker compose
This commit is contained in:
+2
-3
@@ -3,14 +3,13 @@ from contextlib import asynccontextmanager
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from .database import Base, engine
|
||||
from .routers import annotations, auth, pdfs
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
# Create all tables on startup (use Alembic for migrations in production)
|
||||
Base.metadata.create_all(bind=engine)
|
||||
# Tables are managed by Alembic migrations.
|
||||
# Run: alembic upgrade head (done by docker-compose entrypoint)
|
||||
yield
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user