Skip to content

Set up Liquibase to handle database changes #12

@ebouchut

Description

@ebouchut

Note

Liquibase is an open-source database schema change management tool that allows you to track, version, and deploy database changes in a structured and repeatable way.

  • Use Liquibase to version control database changes
    • Read the doc
    • Add the Liquibase Maven dependency to pom.xml
      <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
      </dependency>
    • Configure Liquibase in application.yaml to validate the database schema every time the application starts
      spring:
        liquibase:
          enabled: true
          change-log: classpath:db/changelog/db.changelog-master.yaml
        jpa:
          hibernate:
            ddl-auto: validate
      The ddl-auto: validate setting asks Spring Boot to verify that the database structure is in sync with entities every time it starts.
    • Create the master changelog file:
      src/main/resources/db/changelog/db.changelog-master.yaml

Metadata

Metadata

Assignees

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions