Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[DEV-57] local 환경 flyway, db 환경 설정 변경 #112

Merged
merged 4 commits into from
Sep 10, 2024
Merged

Conversation

5uhwann
Copy link
Collaborator

@5uhwann 5uhwann commented Sep 9, 2024

🚀 작업 내용

flyway 마이그레이션 프로세스 로컬 환경 적용

deleted_at 컬럼 타입 지정

  • 스프링부트 버전 업에 따라 하이버네이트도 같이 버전 업이 되면서 LocalDateTime에 대한 자동 생성 타입을 timestamp가 아닌 datetime로 변경됨. 이에 deleted_at 타입을 명시적으로 timestamp로 지정

db constraint key 네이밍 컨벤션 적용

  • jpa를 통해 랜덤값으로 자동으로 생성되던 key 네이밍을 컨벤션에 맞게 수정.
    • fk: FK_테이블명_참조테이블명_참조컬럼명
    • uk: UK_컬럼명

🤔 고민했던 내용

기존에 적용하려던 flyway롤백 프로세스는 구현 난이도 뿐만 아니라 롤백 스크립트를 생성하는 리소스가 오히려 더 들거라는 판단이 들어 방법을 수정하였습니다.
이미 개발환경에 반영된 후 마이그레이션 실패를 확인하던 것이 문제라 생각하여 로컬 환경 단계서부터 ddl-auto: create 를 통해 테이블을 생성하는 것이 아닌 로컬환경에서부터 flyway를 통해 ddl을 수정하는 방향으로 변경하여 리스크를 줄이고자 했습니다.

💬 리뷰 중점사항

@5uhwann 5uhwann added 🎯리팩토링 리팩토링 및 고도화 이슈 ⚒️설정 설정 관련 이슈 D-0 labels Sep 9, 2024
@5uhwann 5uhwann self-assigned this Sep 9, 2024
Copy link
Collaborator

@wonjunYou wonjunYou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다!! 고생하셨어요 :)

@wonjunYou
Copy link
Collaborator

🤔 고민했던 내용

기존에 적용하려던 flyway롤백 프로세스는 구현 난이도 뿐만 아니라 롤백 스크립트를 생성하는 리소스가 오히려 더 들거라는 판단이 들어 방법을 수정하였습니다. 이미 개발환경에 반영된 후 마이그레이션 실패를 확인하던 것이 문제라 생각하여 로컬 환경 단계서부터 ddl-auto: create 를 통해 테이블을 생성하는 것이 아닌 로컬환경에서부터 flyway를 통해 ddl을 수정하는 방향으로 변경하여 리스크를 줄이고자 했습니다.

너무 좋은 아이디어네요! 매번 머지 후에 개발서버가 종종 죽는 일이 잦았는데, 로컬 단계에서 사전에 체크할 수 있도록 하는 방향이 더욱 안전한 것 같습니다 :)

Copy link
Collaborator

@KoSeonJe KoSeonJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인 하였습니다!
FK, UK 네이밍 컨벤션 좋은 것 같습니다. 고생하셨습니다!

@5uhwann 5uhwann merged commit be8c59b into develop Sep 10, 2024
@5uhwann 5uhwann deleted the chore/DEV-57 branch September 10, 2024 03:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
D-0 ⚒️설정 설정 관련 이슈 🎯리팩토링 리팩토링 및 고도화 이슈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants