implemented
This commit is contained in:
parent
a31bd8246c
commit
d3638e2e69
18 changed files with 1643 additions and 120 deletions
|
|
@ -11,11 +11,16 @@ from routes import audit as audit_routes
|
|||
from routes import profile as profile_routes
|
||||
from routes import invites as invites_routes
|
||||
from routes import auth as auth_routes
|
||||
from routes import meta as meta_routes
|
||||
from validate_constants import validate_shared_constants
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
"""Create database tables on startup."""
|
||||
"""Create database tables on startup and validate constants."""
|
||||
# Validate shared constants match backend definitions
|
||||
validate_shared_constants()
|
||||
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
yield
|
||||
|
|
@ -39,3 +44,4 @@ app.include_router(audit_routes.router)
|
|||
app.include_router(profile_routes.router)
|
||||
app.include_router(invites_routes.router)
|
||||
app.include_router(invites_routes.admin_router)
|
||||
app.include_router(meta_routes.router)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue