We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6b3fa3a + 5ec9ef1 commit 34c8b60Copy full SHA for 34c8b60
1 file changed
backend/src/main/java/com/postdm/backend/global/init/DummyDataInitializer.java
@@ -13,6 +13,8 @@
13
14
import lombok.extern.slf4j.Slf4j;
15
16
+import java.util.Optional;
17
+
18
@Slf4j
19
@Component
20
@RequiredArgsConstructor
@@ -23,6 +25,12 @@ public class DummyDataInitializer implements CommandLineRunner {
23
25
24
26
@Override
27
public void run(String... args) {
28
+ Optional<Member> userOptional = memberRepository.findById(1L);
29
+ if (userOptional.isEmpty()) {
30
+ log.warn("ID가 1인 유저가 존재하지 않습니다. 더미 데이터 생성을 건너뜁니다.");
31
+ return;
32
+ }
33
34
if (estimateRepository.count() > 0) {
35
log.info("[INIT] 이미 견적서 데이터가 존재합니다. 초기화를 건너뜁니다.");
36
return;
0 commit comments