Files
nuzlocke-tracker/.beans/archive/nuzlocke-tracker-vc5o--seed-moves-and-abilities-tables-names-introduced-g.md
Julian Tabel a6cb309b8b
All checks were successful
CI / backend-tests (push) Successful in 28s
CI / frontend-tests (push) Successful in 28s
chore: archive 42 completed/scrapped beans
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 21:31:23 +01:00

2.2 KiB

title, status, type, priority, created_at, updated_at, parent
title status type priority created_at updated_at parent
Seed moves and abilities tables (names + introduced generation) completed task normal 2026-03-20T15:11:44Z 2026-03-20T15:25:11Z nuzlocke-tracker-neqv

Create and seed moves and abilities tables with name and generation data using the hybrid approach.

Approach

Seed move/ability names with introduced_gen only. Full generation-specific stats (power, accuracy, type changes, effect text) will be added in a follow-up bean.

This enables FK references and autocomplete from boss pokemon fields without blocking on a full moves database.

Checklist

  • Migration: Create moves table (id, name, introduced_gen, type optional)
  • Migration: Create abilities table (id, name, introduced_gen)
  • Models: Create Move and Ability SQLAlchemy models
  • Seed data: Seed all move names with introduced generation (source: PokeAPI or Bulbapedia)
  • Seed data: Seed all ability names with introduced generation
  • Seed script: Add to existing seeding pipeline (backend/src/app/seed/)
  • Schemas: Create basic response schemas for API consumption

Summary of Changes

Migration

  • Created j1e2f3a4b5c6_add_moves_and_abilities_tables.py migration
  • moves table: id, name (unique), introduced_gen, type (optional)
  • abilities table: id, name (unique), introduced_gen
  • Added indexes on introduced_gen for both tables

Models

  • backend/src/app/models/move.py: Move SQLAlchemy model
  • backend/src/app/models/ability.py: Ability SQLAlchemy model
  • Updated models/__init__.py to export both

Schemas

  • backend/src/app/schemas/move.py: MoveResponse, AbilityResponse, and paginated variants
  • Updated schemas/__init__.py to export all new schemas

Seed Data

  • Created backend/scripts/fetch_moves_abilities.py to fetch data from PokeAPI
  • Generated moves.json (937 moves) and abilities.json (367 abilities)
  • Data includes name, introduced generation, and type (for moves)

Seed Pipeline

  • Added upsert_moves and upsert_abilities functions to loader.py
  • Updated run.py to seed moves and abilities after Pokemon
  • Updated verify() to include move/ability counts