We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e23eb7 commit 74213e5Copy full SHA for 74213e5
bitgouel-api/src/main/kotlin/team/msg/common/init/DataInitializer.kt
@@ -41,17 +41,17 @@ class DataInitializer(
41
42
/**
43
* ApplicationReadyEvent가 발행되면 initData가 실행됩니다.
44
- * school, club의 데이터 count가 0이라면 데이터 삽입이 실행됩니다.
+ * school, club id = 1인 엔티티가 존재하면 Data Init을 실행하지 않는다.
45
*/
46
@EventListener(ApplicationReadyEvent::class)
47
@Transactional
48
fun initData() {
49
- if(schoolRepository.count() == 0L) {
+ if(schoolRepository.existsOne(1)) {
50
log.info("=== RUN Init School Data ===")
51
initSchool()
52
}
53
54
- if(clubRepository.count() == 0L) {
+ if(clubRepository.existsOne(1)) {
55
log.info("=== RUN Init Club Data ===")
56
initClub()
57
0 commit comments