DEV Community

Marcin Parśniak
Marcin Parśniak

Posted on

Moving from Hibernate Auto-DDL to Liquibase - Finovara

Hello!

For a long time in my Spring Boot project, I relied on

hibernate.ddl-auto = update
Enter fullscreen mode Exit fullscreen mode

It was simple.
Change an entity → restart the app → the database updates itself.

But when the project grew to 18 entities, I realized something important:

I had zero control over my database history.

So I decided to switch to Liquibase.

What I Changed

  1. Disabled Hibernate auto schema updates
spring:
  jpa:
    hibernate:
      ddl-auto: none

Enter fullscreen mode Exit fullscreen mode

From that moment, Hibernate stopped modifying the database structure.

2. Enabled Liquibase

spring:
  liquibase:
    enabled: true
    change-log: classpath:db/changelog/changelog.xml
Enter fullscreen mode Exit fullscreen mode

3. Added simple changeSets

<changeSet id="1-create-users" author="Marcin Parśniak">
        <createTable tableName="users">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="username" type="VARCHAR(255)">
                <constraints nullable="false" unique="true"/>
            </column>
            <column name="password" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="email" type="VARCHAR(255)">
                <constraints nullable="false" unique="true"/>
            </column>
            <column name="created_at" type="TIMESTAMP"/>
            <column name="profile_image_path" type="VARCHAR(500)"/>
        </createTable>
    </changeSet>
Enter fullscreen mode Exit fullscreen mode

Now Liquibase manages the schema.

If you want to see how im doing it, check out my github profile:

GitHub logo M4rc1nek / finovara-backend

Backend service for a personal finance management application

Finovara

Finovara is a financial management platform designed to help users effectively track analyze, and optimize their income, expenses, and savings The application provides a secure, bank-like experience focused on transparency, financial awareness, and long-term money planning.

🎯 Purpose of the Application

Finovara aims to support users in making better financial decisions by offering clear insights into their financial activity and helping them maintain control over their budgets and savings.

The platform focuses on:

  • organizing income and expenses in a structured way
  • visualizing financial data through charts and statistics
  • supporting saving goals and spending limits
  • providing a virtual wallet concept for daily financial management

🚀 Key Features

  • Secure user authentication and authorization
  • Income and expense tracking
  • Categorization of financial operations
  • Interactive charts and financial statistics
  • Reports summarizing spending and income trends
  • Virtual wallet management
  • Savings goals (e.g. piggy banks)
  • Spending limits and budget control
  • Scalable architecture prepared for future financial…

Top comments (0)