feat: SQL migration for evolution tables and variant/image_url columns (#69) #84

Closed
Claude wants to merge 2 commits from ai/paper-dynasty-database#69 into card-evolution

2 Commits

Author SHA1 Message Date
Cal Corum
094f445fea fix: add pg_conn fixture for integration tests (#84)
Adds the missing `pg_conn` session-scoped pytest fixture to conftest.py.
Without it, the 6 integration tests in test_evolution_migration.py fail
immediately with `fixture 'pg_conn' not found` whenever POSTGRES_HOST is set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 18:31:49 -05:00
Cal Corum
11a499c0ec feat: SQL migration for evolution tables and variant/image_url columns (#69)
Closes #69

- Create migrations/2026-03-12_add_evolution_tables.sql: idempotent
  PostgreSQL migration (BEGIN/COMMIT, all IF NOT EXISTS) that creates
  player_season_stats, evolution_track, evolution_card_state,
  evolution_tier_boost, and evolution_cosmetic tables; adds card.variant
  (INTEGER NULL DEFAULT NULL), battingcard.image_url (VARCHAR(500) NULL),
  and pitchingcard.image_url (VARCHAR(500) NULL).
- Add tests/test_evolution_migration.py: 16 unit tests validate SQL file
  structure (tables, columns, indexes, FK references, idempotency); 6
  integration tests annotated for PostgreSQL execution when POSTGRES_HOST
  is set.
- Add tests/__init__.py and tests/conftest.py (shared test infrastructure
  required for import isolation).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 18:08:31 -05:00