2026-02-08 21:20:30 +01:00
|
|
|
from sqlalchemy import ForeignKey, SmallInteger, String
|
2026-02-08 11:16:13 +01:00
|
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
|
|
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BossPokemon(Base):
|
|
|
|
|
__tablename__ = "boss_pokemon"
|
|
|
|
|
|
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True)
|
|
|
|
|
boss_battle_id: Mapped[int] = mapped_column(
|
|
|
|
|
ForeignKey("boss_battles.id", ondelete="CASCADE"), index=True
|
|
|
|
|
)
|
|
|
|
|
pokemon_id: Mapped[int] = mapped_column(ForeignKey("pokemon.id"), index=True)
|
|
|
|
|
level: Mapped[int] = mapped_column(SmallInteger)
|
|
|
|
|
order: Mapped[int] = mapped_column(SmallInteger)
|
2026-02-08 21:20:30 +01:00
|
|
|
condition_label: Mapped[str | None] = mapped_column(String(100))
|
2026-02-08 11:16:13 +01:00
|
|
|
|
|
|
|
|
boss_battle: Mapped["BossBattle"] = relationship(back_populates="pokemon")
|
|
|
|
|
pokemon: Mapped["Pokemon"] = relationship()
|
|
|
|
|
|
|
|
|
|
def __repr__(self) -> str:
|
|
|
|
|
return f"<BossPokemon(id={self.id}, boss_battle_id={self.boss_battle_id}, pokemon_id={self.pokemon_id})>"
|