-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1898531
commit 09054d2
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
data/db/migration/entity/V1.00.0.8__relocate_composite_constraint_order.sql
This file contains 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,25 @@ | ||
-- 복합 제약 조건을 제거 | ||
ALTER TABLE MAPPING_MEMBER_WORKBOOK | ||
DROP PRIMARY KEY; | ||
|
||
ALTER TABLE MAPPING_WORKBOOK_ARTICLE | ||
DROP PRIMARY KEY; | ||
|
||
ALTER TABLE SUBSCRIPTION | ||
DROP KEY target_member_id; | ||
|
||
ALTER TABLE SUBSCRIPTION | ||
DROP KEY target_workbook_id; | ||
|
||
-- 복합 제약 조건을 추가 | ||
ALTER TABLE MAPPING_MEMBER_WORKBOOK | ||
ADD CONSTRAINT mapping_member_workbook_pk PRIMARY KEY (member_id, workbook_id); | ||
|
||
ALTER TABLE MAPPING_WORKBOOK_ARTICLE | ||
ADD CONSTRAINT mapping_workbook_article_pk PRIMARY KEY (article_id, workbook_id); | ||
|
||
ALTER TABLE SUBSCRIPTION | ||
ADD CONSTRAINT subscription_unique_member_id_target_member_id UNIQUE (member_id, target_member_id); | ||
|
||
ALTER TABLE SUBSCRIPTION | ||
ADD CONSTRAINT subscription_unique_member_id_target_workbook_id UNIQUE (member_id, target_workbook_id); |