Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo API with Liquibase

A simple Spring Boot project demonstrating how to use Liquibase for database version control.

Tech Stack

  • Java 21
  • Spring Boot
  • Spring Data JPA
  • PostgreSQL
  • Liquibase
  • Gradle

Features

  • Create Todo records
  • Database schema management with Liquibase
  • Insert initial data using Liquibase changeSets

Project Structure

src/main/resources/db/changelog
│
├── master.xml
├── 001-create-to-ddo-table.xml
├── 002-add-status-column.xml
├── 003-insert-to-do.xml
├── 004-insert-with-csv.xml
├── master.xml
└── todo.csv

Database Configuration

Configure PostgreSQL credentials in application.yml.

spring:
  datasource:
    url: jdbc:postgresql://localhost:5432/todo_db
    username: postgres
    password: your_password

  jpa:
    hibernate:
      ddl-auto: validate

  liquibase:
    change-log: classpath:db/changelog/master.xml

Running the Application

git clone <repository-url>

cd <project-folder>

Linux / Mac:
./gradlew bootRun
Windows:
gradlew.bat bootRun

When the application starts, Liquibase automatically:

  1. Creates the todos table.
  2. Adds the id and name column.
  3. Modify the id column type.
  4. Adds the status column.
  5. Inserts sample data.

Learning Goals

This project was created for practicing:

  • Liquibase changeSets
  • Database migrations
  • Spring Boot and PostgreSQL integration
  • Schema versioning
  • Seed data insertion

About

A simple Todo API demonstrating database versioning with Liquibase

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages