fixed entrypoint

This commit is contained in:
mpabi 2024-06-23 17:00:31 +00:00
parent 4f121e4ed0
commit 770bb13add
2 changed files with 7 additions and 5 deletions

View File

@ -6,8 +6,8 @@ from app.database import Base
class PassportData(Base): class PassportData(Base):
__tablename__ = 'passport_data' __tablename__ = 'passport_data'
id = Column(Integer, primary_key=True, autoincrement=True) id = Column(Integer, primary_key=True, autoincrement=True)
number = Column(String, unique=True, nullable=False) number = Column(String(255), unique=True, nullable=False)
name = Column(String, nullable=False) name = Column(String(255), nullable=False)
surname = Column(String, nullable=False) surname = Column(String(255), nullable=False)
gender = Column(String, nullable=False) gender = Column(String(255), nullable=False)

View File

@ -1,5 +1,7 @@
from app.database import engine from app.database import engine
from app.models import Base from app.models import Base
import argparse
import uvicorn import uvicorn
def main(port): def main(port):
@ -9,7 +11,7 @@ def main(port):
print("Database tables created.") print("Database tables created.")
# Run the FastAPI app using uvicorn # 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__": if __name__ == "__main__":
# Create argument parser # Create argument parser