📝 Update internal README and referred files (#613)

This commit is contained in:
Sebastián Ramírez
2024-02-25 21:51:56 +01:00
committed by GitHub
parent 42726193d0
commit 544f89f253
3 changed files with 54 additions and 546 deletions

View File

@@ -12,8 +12,13 @@ from app.models import User, UserCreate # noqa: F401
def init_db(session: Session) -> None:
# Tables should be created with Alembic migrations
# But if you don't want to use migrations, create
# the tables un-commenting the next line
# Base.metadata.create_all(bind=engine)
# the tables un-commenting the next lines
# from sqlmodel import SQLModel
# from app.db.engine import engine
# This works because the models are already imported and registered from app.models
# SQLModel.metadata.create_all(engine)
user = session.exec(
select(User).where(User.email == settings.FIRST_SUPERUSER)
).first()