Skip to content

Data.sql is ignored with postgres db [DATAJPA-1709] #2005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Apr 9, 2020 · 2 comments
Closed

Data.sql is ignored with postgres db [DATAJPA-1709] #2005

spring-projects-issues opened this issue Apr 9, 2020 · 2 comments
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@spring-projects-issues
Copy link

hauer-io opened DATAJPA-1709 and commented

Expected Behavior:

  • The sql file "src/main/resources/data.sql"  is run independent from the database during start up**
  • The sql file "src/test/resources/data.sql"  is run independent from the database on test start

 

Actual Behavior:

  • The sql file "src/main/resources/data.sql" is only run with h2 and not postgres during start up
  • The sql file "src/test/resources/data.sql"  is only run with h2 and not postgres on test start

Failed approaches:

  • Use property "spring.datasource.initialization-mode=always"
  • Use property "spring.liquibase.drop-first=true"
  • Use property "spring.jpa.hibernate.ddl-auto=create-drop"

 

Initial analyse:

  • With postgres there is no "DataSourceSchemaCreatedEvent" so the DataSourceInitializer.initSchema() is never run.

 


Affects: 2.2.6 (Moore SR6)

Reference URL: https://github.com/hauer-io/liquibase

@spring-projects-issues
Copy link
Author

Jens Schauder commented

This would be an issue of Spring Boot, not Spring Data JPA. Please submit an issue with Spring Boot: https://github.com/spring-projects/spring-boot/issues

@spring-projects-issues
Copy link
Author

hauer-io commented

Thanks. For reference: spring-projects/spring-boot#20920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

2 participants