Skip to content

Commit

Permalink
Add move_1/move_2, fix indexes/nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
JabLuszko committed Sep 13, 2024
1 parent 140b8e9 commit 6e8aacb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
5 changes: 2 additions & 3 deletions mapadroid/db/DbPogoProtoSubmitRaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,9 +1344,6 @@ async def stations(self, session: AsyncSession, received_timestamp: int,
bread_battle_available: bool = station.is_bread_battle_available
inactive: bool = station.is_inactive

# Is this needed at all?
cooldown_complete = DatetimeWrapper.fromtimestamp(float(station.cooldown_complete_ms / 1000))

stations_seen += 1
logger.debug3(
"Station detected, id: {}, name: {}, lat: {}, lng: {}, start: {}, end: {}, available: {}, "
Expand Down Expand Up @@ -1386,6 +1383,8 @@ async def stations(self, session: AsyncSession, received_timestamp: int,
station_obj.battle_pokemon_gender = pokemon_data.pokemon_display.gender
station_obj.battle_pokemon_costume = pokemon_data.pokemon_display.costume
station_obj.battle_pokemon_alignment = pokemon_data.pokemon_display.alignment
station_obj.move_1 = pokemon_data.move1
station_obj.move_2 = pokemon_data.move2

station_obj.start_time = start_time
station_obj.end_time = end_time
Expand Down
19 changes: 10 additions & 9 deletions mapadroid/db/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,23 +880,24 @@ class Station(Base):
latitude = Column(Double(asdecimal=True), nullable=False)
longitude = Column(Double(asdecimal=True), nullable=False)
name = Column(String(128, 'utf8mb4_unicode_ci'), nullable=False)
battle_spawn = Column(TZDateTime, index=True)
battle_window_start = Column(TZDateTime, index=True)
battle_spawn = Column(TZDateTime)
battle_window_start = Column(TZDateTime)
battle_window_end = Column(TZDateTime, index=True)
battle_pokemon_id = Column(SMALLINT(6))
battle_pokemon_id = Column(SMALLINT(6), index=True)
battle_pokemon_form = Column(SMALLINT(6))
battle_pokemon_costume = Column(SMALLINT(6))
battle_pokemon_gender = Column(TINYINT(1))
battle_pokemon_alignment = Column(SMALLINT(6))
battle_pokemon_move_1 = Column(SMALLINT(6))
battle_pokemon_move_2 = Column(SMALLINT(6))
battle_level = Column(TINYINT(1))
reward_pokemon_id = Column(SMALLINT(6))
reward_pokemon_form = Column(SMALLINT(6))
reward_pokemon_costume = Column(SMALLINT(6))
reward_pokemon_gender = Column(TINYINT(1))
reward_pokemon_alignment = Column(SMALLINT(6))
start_time = Column(TZDateTime, index=True)
end_time = Column(TZDateTime, index=True)
cooldown_complete = Column(TZDateTime, index=True)
bread_battle_available = Column(BOOLEAN)
inactive = Column(BOOLEAN)
last_updated = Column(TZDateTime, index=True)
start_time = Column(TZDateTime, nullable=False)
end_time = Column(TZDateTime, index=True, nullable=False)
bread_battle_available = Column(BOOLEAN, nullable=False)
inactive = Column(BOOLEAN, nullable=False)
last_updated = Column(TZDateTime, index=True, nullable=False)

0 comments on commit 6e8aacb

Please sign in to comment.