From 770bb13add5040bd22984e540364b069d5bccfa0 Mon Sep 17 00:00:00 2001 From: mpabi Date: Sun, 23 Jun 2024 17:00:31 +0000 Subject: [PATCH] fixed entrypoint --- src/app/models.py | 8 ++++---- src/entrypoint.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/models.py b/src/app/models.py index 9c8ce21..4ff020c 100644 --- a/src/app/models.py +++ b/src/app/models.py @@ -6,8 +6,8 @@ from app.database import Base class PassportData(Base): __tablename__ = 'passport_data' id = Column(Integer, primary_key=True, autoincrement=True) - number = Column(String, unique=True, nullable=False) - name = Column(String, nullable=False) - surname = Column(String, nullable=False) - gender = Column(String, nullable=False) + number = Column(String(255), unique=True, nullable=False) + name = Column(String(255), nullable=False) + surname = Column(String(255), nullable=False) + gender = Column(String(255), nullable=False) diff --git a/src/entrypoint.py b/src/entrypoint.py index 291df48..59e6ef9 100644 --- a/src/entrypoint.py +++ b/src/entrypoint.py @@ -1,5 +1,7 @@ from app.database import engine from app.models import Base +import argparse + import uvicorn def main(port): @@ -9,7 +11,7 @@ def main(port): print("Database tables created.") # Run the FastAPI app using uvicorn - uvicorn.run("app.main:app", host="0.0.0.0", port=port, reload=True) + # uvicorn.run("app.main:app", host="0.0.0.0", port=port, reload=True) if __name__ == "__main__": # Create argument parser