diff --git a/models/glory.py b/models/glory.py new file mode 100644 index 0000000..2a1a832 --- /dev/null +++ b/models/glory.py @@ -0,0 +1,28 @@ +from sqlalchemy import Column, String, Integer, Boolean, DateTime, ForeignKey +from sqlalchemy.orm import relationship +from sqlalchemy.sql import func +from core.database import Base +import uuid +from datetime import datetime + +class Glory(Base): + __tablename__ = "glory" + + id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4())) + team_name = Column(String, nullable=False, index=True) + league = Column(String, nullable=False) + points = Column(Integer, default=0) + matches_played = Column(Integer, default=0) + wins = Column(Integer, default=0) + draws = Column(Integer, default=0) + losses = Column(Integer, default=0) + goals_for = Column(Integer, default=0) + goals_against = Column(Integer, default=0) + goal_difference = Column(Integer, default=0) + position = Column(Integer) + is_active = Column(Boolean, default=True) + season = Column(String, nullable=False) + coach = Column(String) + home_stadium = Column(String) + created_at = Column(DateTime, default=func.now()) + updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) \ No newline at end of file