SeaORM 초기 테이블 migration 정의 #14
Merged
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.


close #3
☑️ 완료 태스크
🔎 PR 내용
#10 작업 중에 만든 API를 테스트하려면 실제 DB 테이블이 필요한데,
테이블을 직접 만들기보다 DB 구조 변경 이력을 코드 레벨로 관리하는 게 낫겠다 판단했습니다.
현재 프로젝트에는 SeaORM을 ORM으로 사용해서 엔티티랑 실제 DB 스키마 간의 불일치를 줄이고 있는데요.
DB 변경 이력도 마찬가지로 SeaORM migration을 활용하기로 했습니다.
그래서 #10 작업 중 다시 #3 브랜치로 돌아와서 migration 작성을 하게 된 거죠.
각 테이블들의 초기 구조를 정의하고, up / down 마이그레이션을 작성했습니다.
updownup에서 적용된 변경을 되돌리기 위한 롤백 정의Idenenum컴파일 타임에 식별자 오류를 방지하고 SeaORM DSL과 자연스럽게 연동되도록 구성
이번 PR에서는 마이그레이션 작성까지만 다루고,
애플리케이션 실행 시 실제 마이그레이션을 수행하는 로직은 추가하지 않았는데요.
#10 브랜치 작업 중에 의존성 주입 + state 흐름 정리로
state.rs가 많이 바뀌어서충돌을 피하려고 #10 브랜치에서 이번 PR 내용 받아온 뒤에 추가하려 합니다.
📷 스크린샷
Iden식별자 정의up마이그레이션down마이그레이션