🚚 Refactor and simplify backend file structure (#609)

This commit is contained in:
Sebastián Ramírez
2024-02-25 18:48:02 +01:00
committed by GitHub
parent a065f9c9e8
commit 73b2884057
74 changed files with 29 additions and 29 deletions

View File

@@ -0,0 +1,24 @@
import logging
from sqlmodel import Session
from app.db.engine import engine
from app.db.init_db import init_db
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def init() -> None:
with Session(engine) as session:
init_db(session)
def main() -> None:
logger.info("Creating initial data")
init()
logger.info("Initial data created")
if __name__ == "__main__":
main()