Skip to content
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

chore :: v1.1.2 누락 된 if exists 재추가 #82

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

gunsight1
Copy link
Collaborator

💡 Motivation and Context

여기에 왜 이 PR이 필요했는지, PR을 통해 무엇이 바뀌는지에 대해서 설명해 주세요

  • 이전 PR에서 누락된 sql을 수정하여 다시 올렸습니다.

🔨 Modified

여기에 무엇이 크게 바뀌었는지 설명해 주세요

  • 여기에 세부 변경사항을 설명해주세요
  • 이전 PR 승인 당시엔 있었으나, 공통코드 관련 sql을 수정하고 다시 push 올리면서 없어진 sql 코드를 재 추가하였습니다.
  • 뷰, 함수, 컬럼에 대해 if절을 추가하여 기존에 있다면 삭제, 없다면 패스합니다.

🌟 More

  • 여기에 PR 이후 추가로 해야 할 일에 대해서 설명해 주세요
  • 배포관련 세팅 및 테스트


📋 커밋 전 체크리스트

  • 추가/변경에 대한 단위 테스트를 완료하였습니다.
  • 컨벤션에 맞게 작성하였습니다.

🤟🏻 PR로 완료된 이슈

closes #80, #81

@gunsight1 gunsight1 added the 💾 Database 데이터베이스 관련 label Jan 22, 2024
ALTER TABLE public."member" DROP COLUMN IF EXISTS birthdate;
ALTER TABLE public."member" DROP COLUMN IF EXISTS gender;
ALTER TABLE public."member" ADD COLUMN IF NOT EXISTS age int;
ALTER TABLE public."member" ADD COLUMN IF NOT EXISTS gender int;

-- 복호화 뷰 생성
CREATE
Copy link

Choose a reason for hiding this comment

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

The provided code patch includes the following changes:

  1. The view member_view is dropped using drop view IF EXISTS member_view;. This ensures that the view is only dropped if it exists.
  2. Three functions (member_view_delete_trigger, member_view_insert_trigger, and member_view_update_trigger) are dropped using drop function IF EXISTS <function_name>;. Once again, this ensures that the functions are only dropped if they exist.
  3. The column birthdate in the table member is dropped if it exists using ALTER TABLE public."member" DROP COLUMN IF EXISTS birthdate;.
  4. The column gender in the table member is dropped if it exists using ALTER TABLE public."member" DROP COLUMN IF EXISTS gender;.
  5. The column age is added to the member table if it doesn't exist using ALTER TABLE public."member" ADD COLUMN IF NOT EXISTS age int;.
  6. The column gender is added to the member table if it doesn't exist using ALTER TABLE public."member" ADD COLUMN IF NOT EXISTS gender int;.

Overall, the code appears to handle the dropping of views, functions, and columns gracefully, using appropriate checks for their existence. However, without additional context or knowledge of the specific requirements, it is difficult to provide further improvement suggestions or identify potential bug risks.

Copy link
Collaborator

@linglong67 linglong67 left a comment

Choose a reason for hiding this comment

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

확인했습니다~ 감사합니다!

@@ -1,15 +1,17 @@
-- 복호화 view 삭제
drop view member_view;
drop view IF EXISTS member_view;
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍🏻

Copy link
Collaborator

@chan99k chan99k left a comment

Choose a reason for hiding this comment

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

LGTM

@chan99k chan99k merged commit 7d97a33 into Kernel360:develop Jan 22, 2024
1 check passed
@gunsight1 gunsight1 self-assigned this Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💾 Database 데이터베이스 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants