A1: DB ORM 무결성 + ABM 캐시 로그 동기화#192
Merged
Merged
Conversation
models.py:
- JeonseMonthlyRent.dong_code: String(15) → String(10) + ForeignKey(jeonse_dong_master.dong_code)
· alembic f3c4d5e6a7b8 에서 DB FK 추가 완료, ORM drift 동기화
- 9개 자식 테이블 ForeignKey(seoul_dong_master.dong_code) 추가
· alembic e2b3c4d5f6a7 에서 DB FK 추가 완료, ORM 동기화
· 대상: SeoulDistrictSales, SeoulDistrictStores, SeoulGolmokRent,
SeoulPopulationQuarterly, SeoulTrainingDataset, DistrictSalesSeoul,
SeoulAdstrdChangeIx, SeoulAdstrdFlpop, SeoulAdstrdStor
· column type 그대로 유지 (PostgreSQL string family 호환)
- User / ManagerUser nullable 명시:
· User.plan / agree_terms / is_active / email_verified
· ManagerUser.is_active / is_approved / email_verified
· DB 레벨 NOT NULL DEFAULT 와 ORM 동기화
abm_simulation_service.py:
- L241 redis SET 로그 메시지 ttl=3600s → ttl=86400s
· L240 setex(86400) 와 일치 (PR #186 main.py 와 동일 fix)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A1 영역 (backend/database, services) 한정 ORM 무결성 fix.
DB 마이그레이션은 이미 적용됨. ORM drift 동기화 + nullable 정책 명시.
주요 변경
1. JeonseMonthlyRent FK 동기화
dong_code String(15) → String(10) + ForeignKey(jeonse_dong_master.dong_code)2. Seoul 9개 자식 테이블 ForeignKey 동기화
SeoulDistrictSales,SeoulDistrictStores,SeoulGolmokRent,SeoulPopulationQuarterly,SeoulTrainingDataset,DistrictSalesSeoul,SeoulAdstrdChangeIx,SeoulAdstrdFlpop,SeoulAdstrdStor3. User / ManagerUser nullable 명시
User:plan,agree_terms,is_active,email_verifiedManagerUser:is_active,is_approved,email_verifiedNOT NULL DEFAULT와 ORM 동기화 (드리프트 해소)4. ABM 캐시 로그 메시지 fix
services/abm_simulation_service.py:241ttl=3600s → ttl=86400s위험도
낮음 — DB 변경 0건. ORM-only 동기화. 기존 데이터 영향 0.
미포함 (별도 PR)
same_brand_500m데이터 누락 (다른 담당)Test plan
python -c "from src.database.models import Base; print('ORM OK')"— ORM 컴파일 확인alembic upgrade headno-op🤖 Generated with Claude Code