-
Notifications
You must be signed in to change notification settings - Fork 8
fix: 탈퇴한 사용자가 물리적 삭제가 되지 않았던 문제를 해결한다 #574
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
Open
whqtker
wants to merge
1
commit into
solid-connection:develop
Choose a base branch
from
whqtker:fix/delete-siteuser-correctly
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
src/main/resources/db/migration/V38__add_delete_cascade_option_on_fk.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| ALTER TABLE interested_country DROP FOREIGN KEY FK26u5am55jefclcd7r5smk8ai7; | ||
| ALTER TABLE interested_country | ||
| ADD CONSTRAINT fk_interested_country_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE interested_region DROP FOREIGN KEY FKia6h0pbisqhgm3lkeya6vqo4w; | ||
| ALTER TABLE interested_region | ||
| ADD CONSTRAINT fk_interested_region_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE comment DROP FOREIGN KEY FK11tfff2an5hdv747cktxbdi6t; | ||
| ALTER TABLE comment | ||
| ADD CONSTRAINT fk_comment_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE post DROP FOREIGN KEY FKfu9q9o3mlqkd58wg45ykgu8ni; | ||
| ALTER TABLE post | ||
| ADD CONSTRAINT fk_post_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE post_like DROP FOREIGN KEY FKgx1v0whinnoqveopoh6tb4ykb; | ||
| ALTER TABLE post_like | ||
| ADD CONSTRAINT fk_post_like_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE liked_university_info_for_apply DROP FOREIGN KEY FKkuqxb64dnfrl7har8t5ionw83; | ||
| ALTER TABLE liked_university_info_for_apply | ||
| ADD CONSTRAINT fk_liked_university_info_for_apply_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE application DROP FOREIGN KEY fk_app_site_user; | ||
| ALTER TABLE application | ||
| ADD CONSTRAINT fk_app_site_user | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE gpa_score DROP FOREIGN KEY FK2k65qncfxvol5j4l4hb7d6iv1; | ||
| ALTER TABLE gpa_score | ||
| ADD CONSTRAINT fk_gpa_score_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE language_test_score DROP FOREIGN KEY FKt2uevj2r4iuxumblj5ofbgmqn; | ||
| ALTER TABLE language_test_score | ||
| ADD CONSTRAINT fk_language_test_score_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE mentor DROP FOREIGN KEY fk_mentor_site_user_id; | ||
| ALTER TABLE mentor | ||
| ADD CONSTRAINT fk_mentor_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE mentoring DROP FOREIGN KEY fk_mentoring_site_user_id; | ||
| ALTER TABLE mentoring | ||
| ADD CONSTRAINT fk_mentoring_site_user_id | ||
| FOREIGN KEY (mentee_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE news DROP FOREIGN KEY fk_news_site_user_id; | ||
| ALTER TABLE news | ||
| ADD CONSTRAINT fk_news_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE liked_news DROP FOREIGN KEY fk_liked_news_site_user_id; | ||
| ALTER TABLE liked_news | ||
| ADD CONSTRAINT fk_liked_news_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE chat_participant DROP FOREIGN KEY FK_CHAT_PARTICIPANT_SITE_USER_ID; | ||
| ALTER TABLE chat_participant | ||
| ADD CONSTRAINT fk_chat_participant_site_user_id | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE report DROP FOREIGN KEY fk_report_reporter_id; | ||
| ALTER TABLE report | ||
| ADD CONSTRAINT fk_report_reporter_id | ||
| FOREIGN KEY (reporter_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE user_block DROP FOREIGN KEY fk_user_block_blocker_id; | ||
| ALTER TABLE user_block | ||
| ADD CONSTRAINT fk_user_block_blocker_id | ||
| FOREIGN KEY (blocker_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE user_block DROP FOREIGN KEY fk_user_block_blocked_id; | ||
| ALTER TABLE user_block | ||
| ADD CONSTRAINT fk_user_block_blocked_id | ||
| FOREIGN KEY (blocked_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
|
|
||
| ALTER TABLE mentor_application DROP FOREIGN KEY fk_mentor_application_site_user; | ||
| ALTER TABLE mentor_application | ||
| ADD CONSTRAINT fk_mentor_application_site_user | ||
| FOREIGN KEY (site_user_id) REFERENCES site_user (id) ON DELETE CASCADE; | ||
Oops, something went wrong.
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.
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.
FK ID가 로컬에서와 인스턴스에서가 다를 것 같은데, 하드 코딩된 이유가 따로 있을까요??
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가 stage, prod 환경에서만 동작하고, 확인한 결과 두 환경 모두 FK가 같아서 단순 하드 코딩했습니다