This repository was archived by the owner on Mar 15, 2025. It is now read-only.
DB 버전 관리 방법 찾기 #640
Unanswered
kimminkyeu
asked this question in
이슈 / 버그
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
운영중인 DB에서 칼럼이 바뀌어야 할 경우에 대해
update를 잘 할 수 있는 방법을 찾아서 반영 필요.
문제 상황
createdAt
,updatedAt
을 추가하기 위해 BaseEntity를 상속받는 코드를 추가함ddl-auto : update
이여서 칼럼 추가하면 api 서버 올릴 때 업데이트 ddl문 실행될 거라 생각했음.BaseEntity
의updatedAt
은NOT NULL
조건이 걸려있고,default value
를 설정하지 않았음.따라서 기존 데이터들은
null
로 설정되야 하는데, 이게 위 조건이랑 걸려서 ddl을 실행할 수 없게 됨.일단 해결
기존에 있던 shared_folder 테이블을 밀었음.
근데 이런식으로 칼럼 변경될 때마다 테이블 밀면 안될 것임.
특히 운영 DB는 ddl-auto가 none이기 때문에 ddl 문 관리를 해줄 방법이 필요.
Beta Was this translation helpful? Give feedback.
All reactions