Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinhooke/d767b7214607b648fe3bbcdcc0cb256d to your computer and use it in GitHub Desktop.
Save kevinhooke/d767b7214607b648fe3bbcdcc0cb256d to your computer and use it in GitHub Desktop.
Spring Boot / Spring Data schema init options
#schema init: set spring.jpa.hibernate.ddl-auto=none to use this script
src/main/resources/schema.sql
#data init
src/main/resources/data.sql
#db specific data init script:
#application.properties:
spring.datasource.platform=derby
#init script
src/main/resources/data-derby.sql
#Spring Data / Hibernate schema init from @Entities:
spring.jpa.hibernate.ddl-auto=none | validate | update | create | create-drop
##
## To run a data.sql script during a JUnit test - specify @Sql anotation:
##
@Sql(scripts = "classpath:/data-derby.sql")
public ExampleTest {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment