Add pokemon evolution support across the full stack

- Evolution model with trigger, level, item, and condition fields
- Encounter.current_pokemon_id tracks evolved species separately
- Alembic migration for evolutions table and current_pokemon_id column
- Seed pipeline loads evolution data with manual overrides
- GET /pokemon/{id}/evolutions and PATCH /encounters/{id} endpoints
- Evolve button in StatusChangeModal with evolution method details
- PokemonCard shows evolved species with "Originally" label

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 19:26:49 +01:00
parent c8d8e4b445
commit 9728773a94
19 changed files with 1077 additions and 38 deletions

View File

@@ -0,0 +1,42 @@
"""add evolutions table and current_pokemon_id to encounters
Revision ID: b2c3d4e5f6a7
Revises: a1b2c3d4e5f6
Create Date: 2026-02-05 18:00:00.000000
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'b2c3d4e5f6a7'
down_revision: Union[str, Sequence[str], None] = 'a1b2c3d4e5f6'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.create_table(
'evolutions',
sa.Column('id', sa.Integer(), primary_key=True),
sa.Column('from_pokemon_id', sa.Integer(), sa.ForeignKey('pokemon.id'), nullable=False, index=True),
sa.Column('to_pokemon_id', sa.Integer(), sa.ForeignKey('pokemon.id'), nullable=False, index=True),
sa.Column('trigger', sa.String(30), nullable=False),
sa.Column('min_level', sa.SmallInteger(), nullable=True),
sa.Column('item', sa.String(50), nullable=True),
sa.Column('held_item', sa.String(50), nullable=True),
sa.Column('condition', sa.String(200), nullable=True),
)
op.add_column(
'encounters',
sa.Column('current_pokemon_id', sa.Integer(), sa.ForeignKey('pokemon.id'), nullable=True, index=True),
)
def downgrade() -> None:
op.drop_column('encounters', 'current_pokemon_id')
op.drop_table('evolutions')