title: Why is my import.sql file not automatically running?
body: <p>Working on java spring boot app. Our postgres database is containerized. I can get hibernate to automatically create the tables, but I can't get it to automatically run the import.sql file. Can you please help me figure out what is going on?</p>
  
  <p>Here is the build.gradle file:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath('org.springframework.boot:spring-boot-gradle-plugin:2.1.6.RELEASE')
      }
  }
  
  
  apply plugin: 'application'
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'idea'
  apply plugin: 'org.springframework.boot'
  apply plugin: 'io.spring.dependency-management'
  
  mainClassName = 'idealab.IdeaLabMain'
  
  bootJar {
      baseName = 'idealab'
      excludeDevtools = false //TODO(e-carlin): In production this should be removed
  }
  
  repositories {
      mavenCentral()
  }
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  dependencies {
      compile('org.springframework.boot:spring-boot-devtools') // TODO(e-carlin): Make sure this isn't pulled in in the production jar
      implementation('org.springframework.boot:spring-boot-starter-data-jpa')
      implementation('org.springframework.boot:spring-boot-starter-web')
      implementation('org.postgresql:postgresql')
      testCompile('junit:junit')
  }
  </code></pre>
  
  <p>Here is the application.properties file:</p>
  
  <pre><code>logging.level.org.hibernate=DEBUG
  debug=true
  
  spring.jpa.database=POSTGRESQL
  spring.datasource.platform=postgres
  spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
  spring.datasource.username=postgres
  spring.datasource.password=docker
  spring.jpa.show-sql=true
  spring.jpa.generate-ddl=true
  hibernate.hbm2ddl.auto=create # TODO(e-carlin): This will wipe away the
                                       # database data. Good for dev not for prod
  spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
  
  </code></pre>
  
  <p>Here is the import.sql file located in src/main/resources:</p>
  
  <pre class="lang-sql prettyprint-override"><code>INSERT INTO color_type (color) VALUES ('blue'),('green'),('purple'),('red');
  </code></pre>
  
  <p>And here is an example of this model:</p>
  
  <pre class="lang-java prettyprint-override"><code>package idealab.api.model;
  
  import java.util.Set;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.OneToMany;
  import javax.persistence.Table;
  
  
  
  @Entity
  @Table(name = "color_type")
  public class ColorType {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Integer id;
  
      @OneToMany(targetEntity=PrintModel.class, mappedBy="colorTypeId")   
      private Set&lt;PrintModel&gt; printModel;
  
      @Column(name = "color", nullable = false)
      private String color;
  
      public ColorType(Integer id, String color) {
  
          this.color = color;
      }
  
      //getters and setters
      public String getColor() {
          return color;
      }
  
      public void setColor(String color) {
          this.color = color;
      }
  }
  
  </code></pre>
  
  <p>Thanks for any help you can provide!</p>