https://github.com/faranak-cs/liquibase-playground
Liquibase playground
https://github.com/faranak-cs/liquibase-playground
Last synced: about 2 months ago
JSON representation
Liquibase playground
- Host: GitHub
- URL: https://github.com/faranak-cs/liquibase-playground
- Owner: faranak-cs
- Created: 2024-12-02T11:45:22.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-03-16T19:32:46.000Z (2 months ago)
- Last Synced: 2025-03-16T20:33:28.865Z (2 months ago)
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Liquibase Integration
Liquibase database migration guide
## Getting Started
1. Install Liquibase
```
brew install liquibase
```2. Copy `examples` directory to different directory
```
cp -rf libexec/examples ~/YOUR_PATH
```3. Run H2 database
```
liquibase init start-h2
```4. Deploy all new changes
Go to `/examples/sql` directory first and run following command:
```
liquibase update
```## Local setup
- Create new Liquibase project files
```
liquibase init project
```- Run PostgreSQL container
```
docker run -d --name pgtest -p 5432:5432 -e POSTGRES_PASSWORD=admin123 pgvector/pgvector:pg16
```- Deploy changes
```
liquibase update
```- Output

## Maven setup
- Add dependencies in `pom.xml`:```
21
1.0.0-SNAPSHOT
4.27.0org.liquibase
liquibase-core
${liquibase.version}```
- Set liquibase properties in `application.yml`:
```
spring:
liquibase:
change-log: classpath:db/changelog/db.changelog-master.xml
```- Add following files under `/src/main/resources/`
- `db.changelog-master.xml` as main liquibase file
- `db.changelog-0.0.1.xml` being referenced in `db.changelog.xml`
- `/sql/01-create-products-schema.sql` being referenced in `db.changelog-0.0.1.xml`- Run the Application
## Load Data from CSV
```
```
## Arch Diagram
> SQL -> ChangeSet -> ChangeLog -> Liquibase -> Database:
## Dir Structure

## Useful Links
- https://docs.liquibase.com/commands/init/project.html