Repeatable Database Updates via Liquibase

  • Postat în IT
  • la 07-02-2023 15:44
  • de Horatiu Dan
  • 167 vizualizări

by Horatiu Dan

Abstract

The main purpose of this tutorial is to present a way of detecting modifications to a stored Liquibase change set that was previously applied and execute it again automatically. In order to illustrate this, a small proof of concept is constructed gradually. In the first step, the application configures Liquibase as its migration manager and creates the initial database schema. Then, modifications are applied to the running version and lastly, the repeatable script is introduced and enhanced.

Set-up Java 17 Spring Boot v.3.0.2 Liquibase 4.17.2 PostgreSQL 12.11 Maven Proof of Concept

As PostgreSQL was chosen for the database layer of this service, first a new schema is created (liquirepeat). This can be easily accomplished by issuing the following SQL command, after previously connecting to the database.

create schema liquirepeat;

At ap...