Created
July 19, 2019 22:53
-
-
Save kevinhooke/d767b7214607b648fe3bbcdcc0cb256d to your computer and use it in GitHub Desktop.
Spring Boot / Spring Data schema init options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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