gamerewards has a FK to player (player_id), so it must be migrated
after the player table. Previously this caused the Pablo Sanchez Card
reward (id=9, player_id=9399) to fail with FK violation.
PostgreSQL requires GROUP BY for all non-aggregated columns when using
aggregate functions. Added group_by(pitcher, game) to the StratPlay query
that calculates pitcher innings in the /decisions/rest endpoint.
- Fix NULL handling for FK checks in stratplays.py: use x.field_id instead
of x.field to avoid triggering FK lookups on potentially missing rows
- Cast boolean is_start to integer for SUM() - PostgreSQL cannot sum booleans
- Add missing GROUP BY clause to Decision aggregate query
- Add Case import for boolean-to-integer casting
- Update migration script with boolean/datetime column mappings
- Exclude legacy battingstat/pitchingstat tables from migration
- Add comprehensive POSTGRES_MIGRATION_GUIDE.md documentation
Tested: /plays/batting and /plays/pitching endpoints work with group_by=player
NumPy 2.x requires X86_V2 instruction set (SSE4.2/AVX) which
the production server CPU doesn't support. Pin to numpy 1.x
to avoid RuntimeError on startup.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add SQL migration script to update all franchise values
- Change AI roster queries from Team.lname to Team.sname
- Add FRANCHISE_NORMALIZE helper for bulk imports
- Update St Louis Cardinals hardcoded fix
Enables cross-era player matching for AI rosters (fixes Oakland Athletics issue)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Initial version: 1.5
This file tracks the current version for Docker builds. When building
and pushing new versions, this file will be updated and the commit
will be tagged with the version number.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- db_engine.py calls db.create_tables() at import time
- Multiple gunicorn workers cause duplicate key violations
- Run API locally for better development experience
- Keeps postgres and adminer services only
- Switch from Docker volume to local directory mount to avoid space issues
- Comment out API service (run locally for development)
- Create logs/database directory
- Add postgres_data/ to .gitignore
- Fixes 'No space left on device' error
- PostgreSQL 17 Alpine container with health checks
- Adminer database UI on port 8080
- Persistent volumes for data
- Environment variable support via .env
- Comprehensive quickstart guide with common commands
- Troubleshooting section
- Production considerations
- Update .gitignore to allow base docker-compose.yml
- Documents all environment variables
- Includes SQLite and PostgreSQL configurations
- Provides example configurations for different environments
- Adds security notes and best practices
- Includes migration notes for PostgreSQL transition
- Refactor get_batting_totals() to conditionally build SELECT fields based on group_by parameter
- Refactor get_pitching_totals() with same pattern
- Ensures all non-aggregated SELECT fields are included in GROUP BY clause
- Based on successful Major Domo migration pattern
- Add environment-based PostgreSQL configuration to db_engine.py
- Add table_name to all 30 models (Meta class)
- Update db_migrations.py to auto-select migrator based on DB type
- Add comprehensive PostgreSQL migration plan document