Add Mega Millions table to the database

This commit is contained in:
chris committed 2026-03-04 12:52:19 -05:00
1 parent a1c5bd951b
commit c157dcba28
1 file changed
+27
+27
View File
@@ -77,3 +77,30 @@ class PowerballDraw(Base):
self.main_ball4 == other.main_ball4 and self.main_ball5 == other.main_ball5 and \
self.powerball == other.powerball and self.power_play == other.power_play
class MegaMillionsDraw(Base):
__tablename__ = 'mega_millions_draws'
draw_date: Mapped[datetime.date] = mapped_column(Date, primary_key=True)
main_ball1: Mapped[int] = mapped_column(Integer)
main_ball2: Mapped[int] = mapped_column(Integer)
main_ball3: Mapped[int] = mapped_column(Integer)
main_ball4: Mapped[int] = mapped_column(Integer)
main_ball5: Mapped[int] = mapped_column(Integer)
mega_ball: Mapped[int] = mapped_column(Integer)
megaplier: Mapped[int] = mapped_column(Integer)
def __repr__(self):
return f"MegaMillionsDraw({self.draw_date=}, {self.main_ball1=}, {self.main_ball2=}, {self.main_ball3=}, " \
f"{self.main_ball4=}, {self.main_ball5=}, {self.mega_ball=}, {self.megaplier=})"
def __str__(self):
return f"{self.draw_date}, [{self.main_ball1}, {self.main_ball2}, {self.main_ball3}, {self.main_ball4}, " \
f"{self.main_ball5}], {self.mega_ball}, {self.megaplier if self.megaplier else 1}x"
def __eq__(self, other):
return self.draw_date == other.draw_date and self.main_ball1 == other.main_ball1 and \
self.main_ball2 == other.main_ball2 and self.main_ball3 == other.main_ball3 and \
self.main_ball4 == other.main_ball4 and self.main_ball5 == other.main_ball5 and \
self.mega_ball == other.mega_ball and self.megaplier == other.megaplier