-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BE] refactor: 이전의 review 테이블을 삭제하고, new_review 테이블만을 사용하도록 변경 #1104
Conversation
Test Results159 tests 156 ✅ 5s ⏱️ Results for commit b9c578d. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이제보니 ddl-auto: validate가 안돼서 CD 도 실패했었네요 ^^ㅠ
이걸 왜 지금 확인했을까...
-- 이전에 review 테이블 변경 사항 중 new_review가 아닌 review에 적용된 사항을 다시 반영합니다. | ||
ALTER TABLE new_review ADD COLUMN member_id BIGINT NULL; | ||
|
||
-- 기존 review 테이블을 삭제하고, ew_review 테이블의 이름을 "review"로 변경합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 기존 review 테이블을 삭제하고, ew_review 테이블의 이름을 "review"로 변경합니다. | |
-- 기존 review 테이블을 삭제하고, new_review 테이블의 이름을 "review"로 변경합니다. |
BEGIN | ||
DROP TABLE IF EXISTS review; | ||
ALTER TABLE new_review RENAME TO review; | ||
COMMIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BEGIN | |
DROP TABLE IF EXISTS review; | |
ALTER TABLE new_review RENAME TO review; | |
COMMIT | |
START TRANSACTION; | |
DROP TABLE IF EXISTS review; | |
ALTER TABLE new_review RENAME TO review; | |
COMMIT; |
BEGIN은 일부 SQL 모드에서 자동 커밋을 끄지 않을 수도 있으므로,
START TRANSACTION 을 사용하는게 안전하다고 하네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
호오.. 반영했습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테드 자꾸 추가해서 미안한데,
flyway는 각 마이그레이션 스크립트가 자체적으로 하나의 트랜잭션으로 실행되어서
별도로 트랜잭션으로 묶을 필요가 없다고 합니다😅
Flyway wraps the execution of each migration script in a single transaction and applies them in order.
https://documentation.red-gate.com/fd/migration-transaction-handling-273973399.html
트랜잭션 부분 없애도 될 것 같아요!
이해완👍👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 어떤 기능을 구현했나요 ?
🔥 어떻게 해결했나요 ?
📝 어떤 부분에 집중해서 리뷰해야 할까요?
📚 참고 자료, 할 말