Major Domo Database - PostgreSQL database service for SBA bot
Major database enhancement implementing fast-querying season batting stats: Database Schema: - Created seasonbattingstats table with composite primary key (player_id, season) - All batting stats (counting + calculated): pa, ab, avg, obp, slg, ops, woba, etc. - Proper foreign key constraints and performance indexes - Production-ready SQL creation script included Selective Update System: - update_season_batting_stats() function with PostgreSQL upsert logic - Triggers on game PATCH operations to update affected player stats - Recalculates complete season stats from stratplay data - Efficient updates of only players who participated in modified games API Enhancements: - Enhanced SeasonBattingStats.get_top_hitters() with full filtering support - New /api/v3/views/season-stats/batting/refresh endpoint for season rebuilds - Updated views endpoint to use centralized get_top_hitters() method - Support for team, player, min PA, and pagination filtering Infrastructure: - Production database sync Docker service with SSH automation - Comprehensive error handling and logging throughout - Fixed Peewee model to match actual table structure (no auto-id) - Updated CLAUDE.md with dev server info and sync commands 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .claude/plans | ||
| app | ||
| scripts | ||
| test-storage | ||
| .dockerignore | ||
| .env | ||
| .gitignore | ||
| =2.9.0 | ||
| api_data_integrity_tests.py | ||
| CLAUDE.md | ||
| comprehensive_api_integrity_tests.py | ||
| COMPREHENSIVE_API_TEST_COVERAGE.md | ||
| create_season_batting_stats_table.sql | ||
| CUSTOM_COMMANDS_MIGRATION.md | ||
| DATA_SANITIZATION_TEMPLATE.md | ||
| db_engine.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.optimized | ||
| LICENSE | ||
| main.py | ||
| migrate_custom_commands.py | ||
| migrate_to_postgres.py | ||
| migration_issues_tracker.md | ||
| MIGRATION_METHODOLOGY.md | ||
| MIGRATION_QUICK_REFERENCE.md | ||
| migrations.py | ||
| optimize_postgres.sql | ||
| pd_master.db | ||
| POSTGRESQL_MIGRATION_DATA_INTEGRITY_ISSUE.md | ||
| POSTGRESQL_OPTIMIZATIONS.md | ||
| PRODUCTION_MIGRATION_CHECKLIST.md | ||
| quick_data_comparison.py | ||
| requirements.txt | ||
| reset_postgres.py | ||
| run_optimization.py | ||
| test_migration_workflow.sh | ||
| test_postgres.py | ||
| test_requirements.txt | ||
| validate_migration.py | ||