Commit Graph

8 Commits

Author SHA1 Message Date
Cal Corum
99f501e748 Fix custom command creator POST validation (v2.3.1)
Changed CustomCommandCreatorModel.id from required `int` to `Optional[int] = None`
to allow POST requests to create new creators without specifying an ID (database
auto-generates it).

Bug: Users couldn't create custom commands with /new-cc - API returned 422 error
"Field required" for missing id field.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-13 16:31:47 -06:00
Cal Corum
d9ca88c1c8 Fix custom command creation constraint violation
Exclude 'creator' nested object from model_dump when creating custom commands.
The issue was that Pydantic was including both creator_id and creator fields,
causing Peewee to receive a nested dict that resulted in NULL creator_id values
in the database insert, violating the NOT NULL constraint.

This fix ensures only creator_id is passed to the ORM for foreign key mapping.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 08:09:44 -06:00
Cal Corum
e75c1fbc7d CLAUDE: Complete PostgreSQL migration for custom commands
- Update CLAUDE.md to reflect PostgreSQL-only architecture
- Add table_name Meta class to CustomCommand models for PostgreSQL
- Remove SQLite-specific LIKE queries, use PostgreSQL ILIKE
- Refactor custom command creator info handling
- Add helper functions for database operations
- Fix creator data serialization in execute endpoint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 16:07:18 -05:00
Cal Corum
d32f9a8239 Added HelpCommands 2025-10-17 16:36:40 -05:00
Cal Corum
c05d00d60e DB Error Handling
Added error handling wrapper and fixed SQLite -> Postgres issues
2025-08-20 19:33:40 -05:00
Cal Corum
79a559088a CLAUDE: Phase 1 PostgreSQL migration fixes complete
- Fixed 4 critical schema issues blocking migration
- Resolved integer overflow by converting Discord IDs to strings
- Fixed VARCHAR length limits for Google Photos URLs
- Made injury_count field nullable for NULL values
- Successfully migrating 7/30 tables (5,432+ records)

Issues resolved:
- CONSTRAINT-CURRENT-INJURY_COUNT-001: Made nullable
- DATA_QUALITY-PLAYER-NAME-001: Increased VARCHAR limits to 1000
- MIGRATION_LOGIC-TEAM-INTEGER-001: Discord IDs now strings
- MIGRATION_LOGIC-DRAFTDATA-INTEGER-001: Channel IDs now strings

New issues discovered for Phase 2:
- CONSTRAINT-CURRENT-BSTATCOUNT-001: NULL stats count
- CONSTRAINT-TEAM-AUTO_DRAFT-001: NULL auto draft flag

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 18:09:45 -05:00
Cal Corum
27369a92fb Added custom_commands endpoint 2025-08-18 16:27:39 -05:00
Cal Corum
57c943e340 CLAUDE: Add custom commands system with migration from legacy database
- Add CustomCommandCreator and CustomCommand models to db_engine.py
- Add comprehensive custom commands API router with full CRUD operations
- Include migration script for transferring 140 commands from sba_is_fun.db
- Add FastAPI integration for /api/v3/custom_commands endpoints
- Implement usage tracking, search, autocomplete, and statistics features
- Add grace period handling for unused commands to prevent deletion
- Include comprehensive documentation for migration process

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-17 16:31:39 -05:00