Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 3 additions & 11 deletions src/main/java/com/example/solidconnection/term/domain/Term.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,11 @@ public class Term {
@Column(length = 20)
private String name;

@Column(name = "is_current", nullable = false)
private boolean isCurrent = false;
@Column(name = "is_current", unique = true)
private Boolean isCurrent;

public Term(String name, boolean isCurrent) {
this.name = name;
this.isCurrent = isCurrent;
}

public void setAsCurrent() {
this.isCurrent = true;
}

public void setAsNotCurrent() {
this.isCurrent = false;
this.isCurrent = isCurrent ? true : null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ALTER TABLE term
MODIFY COLUMN is_current BOOLEAN NULL DEFAULT NULL;

UPDATE term
SET is_current = NULL
WHERE is_current = FALSE;

ALTER TABLE term
ADD CONSTRAINT uk_term_is_current UNIQUE (is_current);
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MentorQueryServiceTest {

@BeforeEach
void setUp() {
termFixture.현재_학기("2025-2");
termFixture.현재_학기("2025-1");
university = universityFixture.그라츠_대학();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class MyPageServiceTest {
@BeforeEach
void setUp() {
user = siteUserFixture.사용자();
term = termFixture.현재_학기("2025-2");
term = termFixture.현재_학기("2025-1");
UnivApplyInfo 괌대학_A_지원_정보 = univApplyInfoFixture.괌대학_A_지원_정보(term.getId());
괌대학_A_지원_정보_ID = 괌대학_A_지원_정보.getId();
괌대학 = 괌대학_A_지원_정보.getUniversity();
Expand Down
Loading