Skip to content

Spring Boot Liquibase Changelog

DodaTech 1 min read

In this tutorial, you'll learn about Fix Spring Boot Liquibase Changelog Not Applied. We cover key concepts, practical examples, and best practices.

The Problem

Liquibase changelogs are not executed and the database schema is not created.

Quick Fix

Place changelog correctly

Wrong:

// changelog in wrong location

Output:

Changelog not found

Right:

# db/changelog/db.changelog-master.yaml
spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.yaml

Output:

Changelog found

Use correct YAML format

Wrong:

databaseChangeLog:
  - changeSet:
      id: 1
      author: dev
    # Wrong structure

Output:

Parsing error

Right:

databaseChangeLog:
  - changeSet:
      id: 1
      author: dev
      changes:
        - createTable:
            tableName: users

Output:

Correct changelog format

Disable spring.jpa.hibernate.ddl-auto

Wrong:

spring.jpa.hibernate.ddl-auto=update
// Conflicts with Liquibase

Output:

Schema conflicts

Right:

spring.jpa.hibernate.ddl-auto=none

Output:

No conflict with Liquibase

Prevention

  • Place changelog in db/changelog/ directory
  • Use correct Liquibase YAML format
  • Disable hibernate.ddl-auto when using Liquibase

Common Mistakes with boot liquibase changelog

  1. Misunderstanding that String is [Char] with poor performance for large text operations
  2. Using foldl instead of foldl' causing stack overflow on large lists
  3. Forgetting deriving (Show, Eq) on custom data types needed for debugging

These mistakes appear frequently in real-world SPRING code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why are Liquibase changes not applied?

Check that the changelog file is in the correct location and spring.liquibase.change-log is set.

This quick fix is part of the DodaTech Spring & JVM ecosystem series. Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro