AI DB 엔티티와 레포지토리 추가#7
Conversation
There was a problem hiding this comment.
Code Review
This pull request sets up the database schema, SQLAlchemy models, repositories, and Alembic migrations for an AI trading system, including tables for model versions, decision logs, and SHAP values. The reviewer provided highly actionable feedback to improve the implementation, such as enforcing a single 'CHAMPION' model version using a partial unique index, using timezone-aware datetimes, properly mapping SQLAlchemy Enum types to ensure runtime conversion, optimizing queries with a composite index on decision logs, and replacing plain assert statements in tests with proper unittest assertions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
✨ 작업 내용
app/패키지 구조로 정리하고 기존main.py호환 경로를 유지했습니다.decision_logs,shap_values,model_versionsORM 엔티티와 최소 레포지토리를 추가했습니다.arena_aiDB 초기화 SQL을 연결했습니다.write-pr스킬이 저장소 PR 템플릿을 읽고 채우도록 명시했습니다.🔍 리뷰 시 참고사항
challenge_id,order_id는 Spring Boot DB 논리 참조라 FK를 만들지 않았습니다.shap_values.decision_id만 AI 서비스 내부 테이블 FK로 설정했습니다.docker-entrypoint-initdb.dSQL이 재실행되지 않으므로arena_aiDB를 수동 생성해야 할 수 있습니다.✅ 체크리스트
.env.example등) 변경이 필요한 경우 작성 또는 수정했나요?📎 관련 이슈(선택)