From 276faf321606924ac1488ef9f5c02582f8ca3882 Mon Sep 17 00:00:00 2001 From: Isaac Beh Date: Fri, 29 Nov 2024 16:31:20 +1000 Subject: [PATCH] A quick fix until we remove the column from the database --- uqcsbot/advent.py | 4 ++-- uqcsbot/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/uqcsbot/advent.py b/uqcsbot/advent.py index f0e4385..da5759e 100644 --- a/uqcsbot/advent.py +++ b/uqcsbot/advent.py @@ -603,7 +603,7 @@ async def register_command(self, interaction: discord.Interaction, aoc_name: str ) return - db_session.add(AOCRegistrations(aoc_userid=AOC_id, discord_userid=discord_id)) + db_session.add(AOCRegistrations(aoc_userid=AOC_id, discord_userid=discord_id, year=2024)) # this is a quick fix unitl we drop the column in the database db_session.commit() db_session.close() @@ -674,7 +674,7 @@ async def register_admin_command( ) return - db_session.add(AOCRegistrations(aoc_userid=aoc_id, discord_userid=discord_id)) + db_session.add(AOCRegistrations(aoc_userid=aoc_id, discord_userid=discord_id, year=2024)) # this is a quick fix unitl we drop the column in the database db_session.commit() db_session.close() diff --git a/uqcsbot/models.py b/uqcsbot/models.py index f117a9b..6211f7a 100644 --- a/uqcsbot/models.py +++ b/uqcsbot/models.py @@ -34,7 +34,7 @@ class AOCRegistrations(Base): "discord_userid", BigInteger, primary_key=True, nullable=False ) aoc_userid: Mapped[int] = mapped_column("aoc_userid", Integer, nullable=False) - + year: Mapped[int] = mapped_column("year", Integer, nullable=False) # Try to remove this column from the database at some point class MCWhitelist(Base): __tablename__ = "mc_whitelisted"