How to overwrite instead of append SQL-Schema definitions with auto schema-generation in Hibernate?

Viewed 100

I configured my Spring Boot Project to create a SQL file from my Entities with Hibernate:

spring:
  profiles: devlocal
  jpa:
    hibernate.ddl-auto: "create-drop"
    hibernate.hbm2ddl.charset_name: "UTF-8"
    properties:
      javax:
        persistence:
          schema-generation:
            scripts:
              action:  "drop-and-create"
              create-target: "src/main/resources/data/definition/create.sql"
              drop-target: "src/main/resources/data/definition/drop.sql"
              create-source: "metadata"
              drop-source: "metadata"
    open-in-view: true

When executing, the sql statements are appended to the create.sql and drop.sql that they grow longer with every build. Is there a configurative possibility to overwrite/replace it instead?

0 Answers
Related