1d134a24d1
현재 상태: 15개 DB 파일이 3개 위치에 분산 - Canonical (정규): src/quant_engine/ (2) - Legacy/Test: outputs/ (10) - Temp: Temp/ (3) 문제점 식별: 1. kis_data_collection.db: 3개 위치 (1 canonical + 2 legacy) 2. snapshot_admin.db: 4+ 위치 (1 canonical + 3+ legacy) 3. qualitative_sell_strategy.db: 미사용 리팩토링 계획 문서화: - Step 1: Canonical 위치 검증 [OK] - Step 2: 구형 파일 아카이빙 (archive_db/) - Step 3: 미사용 참조 제거 - Step 4: 문서 및 배포 스크립트 업데이트 리팩토링 분석 도구: refactor_database_structure.py Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
60 lines
1.7 KiB
Markdown
60 lines
1.7 KiB
Markdown
|
|
# Database Consolidation Plan (2026-06-23)
|
|
|
|
## Current State: FRAGMENTED
|
|
- Canonical: src/quant_engine/ (2 files)
|
|
- Scattered: outputs/ (10) + Temp/ (3)
|
|
- Total: 15 database files
|
|
|
|
## Issue
|
|
1. kis_data_collection.db in 3 locations:
|
|
- src/quant_engine/ (CANONICAL)
|
|
- outputs/kis_data_collection/
|
|
- Temp/test_kis_data_collection.db
|
|
|
|
2. snapshot_admin.db in 4+ locations:
|
|
- src/quant_engine/ (CANONICAL)
|
|
- outputs/snapshot_admin/
|
|
- Temp/snapshot_admin_*.db (multiple variants)
|
|
- outputs/qualitative_sell_strategy/ (unrelated)
|
|
|
|
## Solution
|
|
|
|
### Step 1: Verify Canonical Copies (src/quant_engine/)
|
|
- kis_data_collection.db: 5 records [OK]
|
|
- snapshot_admin.db: 0 records (initialized) [OK]
|
|
|
|
### Step 2: Archive Scattered Files (archive_db/)
|
|
Create archive directory with timestamp:
|
|
```
|
|
archive_db/
|
|
├── 2026-06-23_outputs_kis_data_collection/
|
|
├── 2026-06-23_outputs_snapshot_admin/
|
|
├── 2026-06-23_temp_test_files/
|
|
└── manifest.json (record what was archived)
|
|
```
|
|
|
|
### Step 3: Clean Obsolete References
|
|
- Remove imports from "outputs/kis_data_collection/kis_data_collection.db"
|
|
- Remove imports from "outputs/snapshot_admin/*.db"
|
|
- Update any code expecting these paths
|
|
|
|
### Step 4: Update Documentation
|
|
- Update all references to use: src/quant_engine/
|
|
- Update deployment docs (Synology)
|
|
- Update CI/CD workflows
|
|
|
|
## Benefits
|
|
- Single source of truth
|
|
- Easier backup/recovery
|
|
- Clear separation: live vs. archived
|
|
- Faster data access
|
|
- Simplified deployment
|
|
|
|
## Files to Delete (After Archiving)
|
|
- outputs/kis_data_collection/ (entire dir)
|
|
- outputs/snapshot_admin/smoke*.db (old test files)
|
|
- outputs/qualitative_sell_strategy/qualitative_sell_strategy.db
|
|
- Temp/snapshot_admin_*.db
|
|
- Temp/test_kis_data_collection.db
|