I just started to Spring Boot and managed to create table in PostgreSQL database. Then I add a config file to my project that would insert data to database. However, as far as I see, the code does not hit this config file and re-create table. I tried to change spring.jpa.hibernate.ddl-auto parameter in application.properties file, but it does not make any sense and as a result, the table is re-created on each app running with empty record (it is also seen on Java console just create table). SO, what I am missing?
application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/student
spring.datasource.username=postgres
spring.datasource.password=******
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=true
StudentConfig:
@Configuration
public class StudentConfig {
    CommandLineRunner commandLineRunner(StudentRepository repository) {
        return args -> {
            Student johnson = new Student(
                    "johnson@gmail.com",
                    "Johnson",
                    LocalDate.of(2000, JANUARY, 5)
            );
            Student alex = new Student(
                    "alex@gmail.com",
                    "alex",
                    LocalDate.of(2010, JANUARY, 17)
            );
            repository.saveAll(List.of(johnson, alex));
        };
    }
}
 
     
    