Cal Corum
40c512c665
Add PostgreSQL compatibility fixes for query ordering
...
- Add explicit ORDER BY id to all queries for consistent results across SQLite and PostgreSQL
- PostgreSQL does not guarantee row order without ORDER BY, unlike SQLite
- Skip table creation when DATABASE_TYPE=postgresql (production tables already exist)
- Fix datetime handling in notifications (PostgreSQL native datetime vs SQLite timestamp)
- Fix grouped query count() calls that don't work in PostgreSQL
- Update .gitignore to include storage/templates/ directory
This completes the PostgreSQL migration compatibility layer while maintaining
backwards compatibility with SQLite for local development.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 10:39:14 -06:00
Cal Corum
0cba52cea5
PostgreSQL migration: Complete code preparation phase
...
- Add db_helpers.py with cross-database upsert functions for SQLite/PostgreSQL
- Replace 12 on_conflict_replace() calls with PostgreSQL-compatible upserts
- Add unique indexes: StratPlay(game, play_num), Decision(game, pitcher)
- Add max_length to Team model fields (abbrev, sname, lname)
- Fix boolean comparison in teams.py (== 0/1 to == False/True)
- Create migrate_to_postgres.py with ID-preserving migration logic
- Create audit_sqlite.py for pre-migration data integrity checks
- Add PROJECT_PLAN.json for migration tracking
- Add .secrets/ to .gitignore for credentials
Audit results: 658,963 records across 29 tables, 2,390 orphaned stats (expected)
Based on Major Domo migration lessons learned (33 issues resolved there)
2026-01-25 23:05:54 -06:00
Cal Corum
1e4569dfbf
Clean up root_validators
...
Remove root_path from FastAPI
Update Season 8 Cardsets
Force pydantic 1.x
2024-11-03 01:46:40 -05:00
Cal Corum
eb49ded2d4
Add player_id to ratings & flashback rename
2023-11-20 01:00:10 -06:00
Cal Corum
d81b63ce92
Update pitchingcardratings.py
...
Fix BB/9 inverse rating
2023-11-19 12:26:33 -06:00
Cal Corum
d9a63e1949
Add scouting update endpoint
2023-11-18 14:45:09 -06:00
Cal Corum
c0a94613a3
Serve scouting by static csv
2023-10-30 10:25:44 -05:00
Cal Corum
24cf331803
Pitching Basic Ratings Complete + Batting Refactor
2023-10-29 17:48:38 -05:00
Cal Corum
07df617ae0
Refactor scouting df pull
2023-10-29 00:50:32 -05:00
Cal Corum
ed6e73528f
Added /scouting error messages
2023-10-20 16:02:43 -05:00
Cal Corum
96be768ec9
Pre-Season 6 Updates
2023-10-19 23:16:47 -05:00
Cal Corum
1776df7173
Final test updates
2023-10-03 12:07:34 -05:00
Cal Corum
561c7e99d4
Pitching card updates for card gen
2023-09-25 00:19:41 -05:00
Cal Corum
6183a125bc
Cards and ratings updates
2023-09-16 17:21:01 -05:00
Cal Corum
51a5251c92
Add pitchercards and ratings
2023-09-16 00:05:10 -05:00