https://github.com/sanogotech/liquidbasestarter
LiquidBase DB Changelog Starter
https://github.com/sanogotech/liquidbasestarter
dbmigration h2 h2-database java liquibase spring spring-boot
Last synced: 27 days ago
JSON representation
LiquidBase DB Changelog Starter
- Host: GitHub
- URL: https://github.com/sanogotech/liquidbasestarter
- Owner: sanogotech
- Created: 2022-10-08T17:00:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-08T19:53:01.000Z (over 3 years ago)
- Last Synced: 2025-08-24T14:12:54.980Z (9 months ago)
- Topics: dbmigration, h2, h2-database, java, liquibase, spring, spring-boot
- Language: Java
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# liquidbasestarter
LiquidBase DB Changelog Starter
* Best Sample : https://github.com/sanogotech/liquibase-springboot
## Docs
- https://www.techgeeknext.com/spring-boot/spring-boot-liquibase-example#google_vignette
- https://www.baeldung.com/liquibase-refactor-schema-of-java-app
- https://docs.liquibase.com/tools-integrations/springboot/using-springboot-with-maven.html
- https://reflectoring.io/database-migration-spring-boot-liquibase/
## Dependencies
```
org.springframework.boot
spring-boot-starter-parent
2.5.3
org.liquibase
liquibase-core
org.springframework.boot
spring-boot-starter-data-jpa
```
## application.properties
```
spring.liquibase.change-log=classpath:liquibase-changeLog.xml *.sql or xml or json or yaml
spring.liquibase.enabled=false
```
## liquibase.properties
```
Windows example: changelog-file: ..\path\to\changelog.sql
Linux example: changelog-file: ../path/to/changelog.sql
url=jdbc:mysql://localhost:3306/oauth_reddit
username=tutorialuser
password=tutorialmy5ql
driver=com.mysql.jdbc.Driver
outputChangeLogFile=src/main/resources/liquibase-outputChangeLog.xml
```
## Changelog example
```xml
```
## Generate a ChangeLog From an Existing Database
```
org.liquibase
liquibase-maven-plugin
3.4.1
org.liquibase
liquibase-maven-plugin
3.4.1
src/main/resources/liquibase.properties
```
```
mvn liquibase:generateChangeLog
```
## Generate a ChangeLog From Diffs Between Two Databases
```
mvn liquibase:diff
```
* liquibase.properties
```
changeLogFile=src/main/resources/liquibase-changeLog.xml
url=jdbc:mysql://localhost:3306/oauth_reddit
username=tutorialuser
password=tutorialmy5ql
driver=com.mysql.jdbc.Driver
referenceUrl=jdbc:h2:mem:oauth_reddit
diffChangeLogFile=src/main/resources/liquibase-diff-changeLog.xml
referenceDriver=org.h2.Driver
referenceUsername=sa
referencePassword=
```
## To roll back any changes
```
create the liquibase.rollback-file file in Spring Boot and generate a rollback script for changes associated with changesets
Ex:
-- rollback drop table test_table;
```