A1: industry_master ORM ForeignKey 배선 + InviteCode nullable#194
Merged
Conversation
models.py:
- IndustryMaster docstring 정정:
· 잘못된 claim "DB FK 9개" 제거 (alembic 검색 결과 0건)
· 자식 13개 type 분포 명시 (8 String(20) + 5 Text)
- 자식 12개 industry_code 컬럼에 ForeignKey(industry_master.industry_code) 추가:
· String(20): GolmokCommercial, DistrictSales, StoreQuarterly,
DistrictSalesSeoul, SeoulAdstrdStor, SeoulSignguSelng, SeoulSignguStor
· Text: GolmokSales, GolmokStores, SeoulDistrictSales,
SeoulDistrictStores, SeoulTrainingDataset
· DB type 그대로 유지 (PostgreSQL string family 호환)
· DB FK constraint 미존재 → ORM-level 만 동기 (DB 마이그레이션 별도 PR)
- InviteCode nullable 명시:
· max_uses, used_count, is_active 에 nullable=False
· DB default 와 ORM 동기화 (드리프트 해소)
위험도: 낮음. ORM-only 변경. DB 변경 0건.
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 영역 ORM 무결성 후속 fix.
주요 변경
IndustryMaster docstring 정정
자식 12개 ORM ForeignKey 배선
ForeignKey("industry_master.industry_code", onupdate="CASCADE")추가InviteCode nullable 명시
max_uses,used_count,is_active에 nullable=False미포함 (별도 PR)
위험도
낮음 — ORM-only 변경. DB 변경 0건. SQLAlchemy 컴파일 검증 완료.
Test plan
python -c "from src.database.models import IndustryMaster, GolmokSales; print('OK')"ORM 컴파일 확인alembic upgrade headno-op🤖 Generated with Claude Code