-
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.
Merge pull request #407 from Namo-log/refactor/406
[Refactor/406] 개인/생일 일정 생성 시 participant 정보도 업데이트 되도록 수정
- Loading branch information
Showing
6 changed files
with
46 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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
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
28 changes: 28 additions & 0 deletions
28
...sql-v2/src/main/resources/db/migration/dev/V1.1.6__Modify_columns_from_schedule_table.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,28 @@ | ||
-- V1.1.6__Modify_columns_from_schedule_table | ||
|
||
-- participant_count 업데이트 | ||
UPDATE schedule | ||
SET | ||
participant_count = 1 | ||
WHERE | ||
schedule_type = 0 | ||
AND participant_count IS NULL; | ||
|
||
-- participant_nicknames 업데이트, 개인/생일 일정에 대해서만 | ||
UPDATE schedule s | ||
SET s.participant_nicknames = ( | ||
SELECT m.nickname | ||
FROM participant p | ||
JOIN member m ON p.member_id = m.id | ||
WHERE p.schedule_id = s.id | ||
) | ||
WHERE s.participant_nicknames IS NULL | ||
AND s.schedule_type IN (0, 2); | ||
|
||
-- NOT NULL 변경 | ||
ALTER TABLE schedule | ||
MODIFY participant_nicknames VARCHAR(255) NOT NULL; | ||
|
||
-- NOT NULL 변경 | ||
ALTER TABLE schedule | ||
MODIFY participant_count INT NOT NULL; |