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

fix : 친구, 친구 초대 유니크 제약 조건 삭제 #606 #609

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-- friend_invite 외래 키 삭제 -> 유니크 키 삭제 -> 외래 키 추가
ALTER TABLE friend_invite
DROP CONSTRAINT fk_friend_invite_owner_id;

ALTER TABLE friend_invite
DROP CONSTRAINT fk_friend_invite_friend_id;

ALTER TABLE friend_invite DROP KEY unique_owner_friend_pair;

ALTER TABLE friend_invite
ADD CONSTRAINT fk_friend_invite_owner_id FOREIGN KEY (owner_id) REFERENCES member (member_id);

ALTER TABLE friend_invite
ADD CONSTRAINT fk_friend_invite_friend_id FOREIGN KEY (friend_id) REFERENCES member (member_id);

-- member_friend 외래 키 삭제 -> 유니크 키 삭제 -> 외래 키 추가
ALTER TABLE member_friend
DROP CONSTRAINT fk_member_friend_owner_id;

ALTER TABLE member_friend
DROP CONSTRAINT fk_member_friend_friend_id;

ALTER TABLE member_friend DROP KEY unique_owner_friend_relation;

ALTER TABLE member_friend
ADD CONSTRAINT fk_member_friend_owner_id FOREIGN KEY (owner_id) REFERENCES member (member_id);

ALTER TABLE member_friend
ADD CONSTRAINT fk_member_friend_friend_id FOREIGN KEY (friend_id) REFERENCES member (member_id);
Loading