-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: studentCode unique 제약조건 수정
- Loading branch information
Showing
2 changed files
with
11 additions
and
12 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
11 changes: 9 additions & 2 deletions
11
backend/src/main/resources/db/migration/V6__studnet_code__unique.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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
alter table student_code | ||
add constraint unique_username__school unique (username, school_id); | ||
create index temp_member_index | ||
on student_code (member_id); | ||
|
||
drop index fk_student_code__member on student_code; | ||
|
||
create unique index fk_student_code__member | ||
on student_code (member_id); | ||
|
||
drop index temp_member_index on student_code; | ||
|
||
alter table student_code | ||
add column issued_at datetime(6); |