-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* snuttId 중복 존재해 테이블 추가 * 리뷰 반영
- Loading branch information
Showing
10 changed files
with
84 additions
and
24 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
api/src/main/kotlin/com/wafflestudio/snuttev/config/FilterConfig.kt
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
18 changes: 18 additions & 0 deletions
18
core/src/main/kotlin/com/wafflestudio/snuttev/core/domain/lecture/model/SnuttLectureIdMap.kt
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,18 @@ | ||
package com.wafflestudio.snuttev.core.domain.lecture.model | ||
|
||
import com.wafflestudio.snuttev.core.common.model.BaseEntity | ||
import jakarta.persistence.Column | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.FetchType | ||
import jakarta.persistence.JoinColumn | ||
import jakarta.persistence.ManyToOne | ||
|
||
@Entity | ||
class SnuttLectureIdMap( | ||
@Column(name = "snutt_id", columnDefinition = "char(24)") | ||
var snuttId: String, | ||
|
||
@ManyToOne(optional = false, fetch = FetchType.LAZY) | ||
@JoinColumn(name = "semester_lecture_id", nullable = false, unique = true) | ||
var semesterLecture: SemesterLecture, | ||
) : BaseEntity() |
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
10 changes: 10 additions & 0 deletions
10
...in/com/wafflestudio/snuttev/core/domain/lecture/repository/SnuttLectureIdMapRepository.kt
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,10 @@ | ||
package com.wafflestudio.snuttev.core.domain.lecture.repository | ||
|
||
import com.wafflestudio.snuttev.core.domain.lecture.model.SnuttLectureIdMap | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.data.jpa.repository.Query | ||
|
||
interface SnuttLectureIdMapRepository : JpaRepository<SnuttLectureIdMap, Long> { | ||
@Query("SELECT ttm FROM SnuttLectureIdMap ttm JOIN FETCH ttm.semesterLecture WHERE ttm.snuttId IN :snuttIds") | ||
fun findAllWithSemesterLectureBySnuttIds(snuttIds: List<String>): List<SnuttLectureIdMap> | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ALTER TABLE semester_lecture DROP COLUMN snutt_id; | ||
CREATE TABLE IF NOT EXISTS snutt_lecture_id_map | ||
( | ||
id BIGINT AUTO_INCREMENT | ||
PRIMARY KEY, | ||
created_at DATETIME(6) NOT NULL, | ||
updated_at DATETIME(6) NOT NULL, | ||
snutt_id CHAR(24) DEFAULT NULL, | ||
semester_lecture_id BIGINT NOT NULL, | ||
CONSTRAINT snutt_lecture_id_map__unique__snutt_id | ||
UNIQUE (snutt_id), | ||
CONSTRAINT snutt_lecture_id_map__fk__semester_lecture_id | ||
FOREIGN KEY (semester_lecture_id) REFERENCES semester_lecture (id) | ||
); |