From 0f19f75d48c0607fd5db3a123407a4a7155c1401 Mon Sep 17 00:00:00 2001 From: Lunix-420 Date: Mon, 11 Nov 2024 16:46:43 +0100 Subject: [PATCH] fix: DefaultValueLoader sucks less now --- .../java/com/maradona/backend/DefaultValueLoader.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/maradona/backend/DefaultValueLoader.java b/src/main/java/com/maradona/backend/DefaultValueLoader.java index 09df26e..f66470c 100644 --- a/src/main/java/com/maradona/backend/DefaultValueLoader.java +++ b/src/main/java/com/maradona/backend/DefaultValueLoader.java @@ -35,11 +35,9 @@ public class DefaultValueLoader implements CommandLineRunner { @Override public void run(String... args) { - // Clear all tables - employeeRepository.deleteAll(); - secondarySkillRepository.deleteAll(); - primarySkillRepository.deleteAll(); - formOfAddressRepository.deleteAll(); + if (employeeRepository.count() > 0) { + return; + } // Create form of addresses FormOfAddress formOfAddress1 = new FormOfAddress(); @@ -48,9 +46,6 @@ public class DefaultValueLoader implements CommandLineRunner { FormOfAddress formOfAddress2 = new FormOfAddress(); formOfAddress2.setDescription("Frau"); - FormOfAddress formOfAddress3 = new FormOfAddress(); - formOfAddress3.setDescription("Einkaufstüte"); - formOfAddress1 = formOfAddressRepository.save(formOfAddress1); formOfAddress2 = formOfAddressRepository.save(formOfAddress2);