springboot:having_spring_to_create_the_database_schema

Having Spring to Create the Database Schema

  1. Add the following in the application.properties file:
    spring.jpa.properties.javax.persistence.schema-generation.scripts.action=drop-and-create
    spring.jpa.properties.javax.persistence.schema-generation.scripts.drop-target=drop.sql
    spring.jpa.properties.javax.persistence.schema-generation.scripts.create-target=create.sql
    spring.jpa.properties.javax.persistence.schema-generation.scripts.create-source=metadata
  2. The create.sql, and drop.sql script will be created in the root directory. If those files have already existed, you might want to delete those first.
  3. The SQL files are created based on your datasource driver.
  4. Remove the above lines from the properties file afterward.
  • springboot/having_spring_to_create_the_database_schema.txt
  • Last modified: 2020/06/01 17:03
  • by chongtin