quarkus: SQL import script not loaded in neither profile (prod, dev, test)

Neither of the scenarios works for me as it goes to loading the SQL file:

  • import.sql file in src/main/resources in profile DEV, TEST, PROD
  • import.sql file in src/test/resources in profile DEV, TEST, PROD

I also tried all the properties:

  • %dev.quarkus.hibernate-orm.sql-load-script = db/data-test.sql
  • %test.quarkus.hibernate-orm.sql-load-script = db/data-test.sql

When no file is present I get the exception that the property is not pointing to the actual file:,

Caused by: io.quarkus.deployment.configuration.ConfigurationError: Unable to find file referenced in 'quarkus.hibernate-orm.sql-load-script=db/data-test-bad.sql'. Remove property or add file to your path.

but when I fix the path the file is not loaded anyways. I even added some no-SQL statement hoping to see errors, but nothing happens.

Environment (please complete the following information):

  • Output of java -version: JDK 11
  • GraalVM version (if different from Java): JDK11
  • Quarkus version or git rev: 1.2.1.Final
  • Postgres

Additional context

  • Flyway migrations get executed properly during the startup.

Related to:

#3661 #6545 #7290

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 17 (10 by maintainers)

Most upvoted comments

I did find the same issue, until I’ve realized that Hibernate only runs the import file if the database.generation is set to create. Not sure if this is the issue of the @kolorobot, but maybe it is.