Skip to content

Commit

Permalink
Merge pull request #14 from pavankjadda/development
Browse files Browse the repository at this point in the history
Upgrade to Liquibase 4.0.0
  • Loading branch information
pavankjadda authored Jul 16, 2020
2 parents 634a49c + 96cc19d commit 52df693
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 91 deletions.
19 changes: 10 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
</parent>
<groupId>com.pj</groupId>
<artifactId>liquibasedemo</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
<name>liquibasedemo</name>
<description>Liquibase Demo project with Spring Boot and Spring Data</description>

<properties>
<spring-boot.version>2.3.1.RELEASE</spring-boot.version>
<hibernate.version>5.4.17.Final</hibernate.version>
<liquibase-core.version>3.10.0</liquibase-core.version>
<liquibase-maven-plugin.version>3.10.0</liquibase-maven-plugin.version>
<liquibase-hibernate5.version>3.10.0</liquibase-hibernate5.version>
<liquibase-core.version>4.0.0</liquibase-core.version>
<liquibase-maven-plugin.version>4.0.0</liquibase-maven-plugin.version>
<liquibase-hibernate5.version>3.10.1</liquibase-hibernate5.version>
<validation-api.version>2.0.1.Final</validation-api.version>
<javassist.version>3.27.0-GA</javassist.version>
<jaxb-api.version>2.4.0-b180830.0359</jaxb-api.version>
Expand Down Expand Up @@ -93,21 +93,21 @@
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<activatedProfile>dev</activatedProfile>
<activeProfile>dev</activeProfile>
</properties>
</profile>

<profile>
<id>test</id>
<properties>
<activatedProfile>test</activatedProfile>
<activeProfile>test</activeProfile>
</properties>
</profile>

<profile>
<id>prod</id>
<properties>
<activatedProfile>prod</activatedProfile>
<activeProfile>prod</activeProfile>
</properties>
</profile>
</profiles>
Expand Down Expand Up @@ -136,8 +136,9 @@
<version>${liquibase-maven-plugin.version}</version>
<configuration>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
<changeLogFile>src/main/resources/db/db.changelog-master.xml</changeLogFile>
<diffChangeLogFile>src/main/resources/db/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
<outputChangeLogFile>src/main/resources/db/db.changelog-${activeProfile}.xml</outputChangeLogFile>
<changeLogFile>src/main/resources/db/db.changelog-${activeProfile}.xml</changeLogFile>
<diffChangeLogFile>src/main/resources/db/changelog/${activeProfile}/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
<logging>info</logging>
</configuration>

Expand Down
17 changes: 3 additions & 14 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,14 @@ spring:
url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}

jpa:
hibernate:
ddl-auto: none

# Liquibase properties
devtools:
restart:
enabled: true
liquibase:
enabled: false

## Server Properties
server:
port: 8080

management:
endpoints:
web:
exposure:
include: ["health","info"]
endpoint:
auditevents:
enabled: true
port: 8081
16 changes: 3 additions & 13 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@ spring:
ddl-auto: update

# Liquibase properties
devtools:
restart:
enabled: true

liquibase:
enabled: false

## Server Properties
server:
port: 8080
port: 8081

management:
endpoints:
web:
exposure:
include: ["health","info"]
endpoint:
auditevents:
enabled: true

15 changes: 3 additions & 12 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,11 @@ spring:
ddl-auto: none

# Liquibase properties
devtools:
restart:
enabled: true
liquibase:
enabled: false

## Server Properties
server:
port: 8080
port: 8081

management:
endpoints:
web:
exposure:
include: ["health","info"]
endpoint:
auditevents:
enabled: true

15 changes: 3 additions & 12 deletions src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,11 @@ spring:
ddl-auto: none

# Liquibase properties
devtools:
restart:
enabled: true
liquibase:
enabled: false

## Server Properties
server:
port: 8080
port: 8081

management:
endpoints:
web:
exposure:
include: ["health","info"]
endpoint:
auditevents:
enabled: true

2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
spring:
profiles:
active: @activatedProfile@
active: '@activeProfile@'
28 changes: 0 additions & 28 deletions src/main/resources/db/changelog/2020-06-22T05:48:08Z_changelog.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<includeAll path="db/changelog/" />
<includeAll path="db/changelog/dev" />
</databaseChangeLog>
6 changes: 6 additions & 0 deletions src/main/resources/db/db.changelog-prod.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<includeAll path="db/changelog/prod" />
</databaseChangeLog>
6 changes: 6 additions & 0 deletions src/main/resources/db/db.changelog-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<includeAll path="db/changelog/test" />
</databaseChangeLog>
9 changes: 8 additions & 1 deletion src/main/resources/liquibase.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

#### Database properties
url=${liquibase.url}
username=${liquibase.username}
password=${liquibase.password}
driver=com.mysql.cj.jdbc.Driver
referenceUrl=hibernate:spring:com.pj.liquibasedemo.domain?dialect=org.hibernate.dialect.MySQL8Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy

#### Reference database properties
referenceUrl=${liquibase.referenceUrl}
referenceDriver=com.mysql.cj.jdbc.Driver
referenceUsername=${liquibase.referenceUsername}
referencePassword=${liquibase.referencePassword}

0 comments on commit 52df693

Please sign in to comment.