79586558

Date: 2025-04-22 13:18:00
Score: 1
Natty:
Report link

1. mvn liquibase:generateChangeLog

It will generate a migration file in the project directory.

2. mvn compile

The generated file will be processed and placed into the classpath (target/classes).

(Make sure the resources folder is marked as a "resource root" so everything gets compiled into the classpath properly.)

3. mvn liquibase:changelogSync

It will find the file from target/classes (step 2) and create a table in the database for tracking migrations,

using the valid file name: db/changelog/db.changelog-master.xml.

After completing these 3 steps, everything will be set up correctly,

and Spring will launch the project and detect the Liquibase baseline.

liquibase.properties

# Important __________________________________________________________________

outputChangeLogFile=src/main/resources/db/changelog/db.changelog-master.xml

changeLogFile=db/changelog/db.changelog-master.xml

classpath=target/classes

# ____________________________________________________________________________

url=jdbc:postgresql://localhost:5432/OnlyHibernateDB

username=postgres

password=Mellon

driver=org.postgresql.Driver

application.properties

# Liquibase

spring.liquibase.change-log=db/changelog/db.changelog-master.xml

spring.liquibase.enabled=true

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Filler text (0.5): __________________________________________________________________
  • Filler text (0): ____________________________________________________________________________
  • Low reputation (1):
Posted by: JuliaMiles