Recently I was looking at Google Cloud Spanner and ClickHouse and found that Liquibase is supported. This surprised me, so I studied Liquibase again.
Why use Liquibase? Liquibase uses XML to define schema most of the time, which brings a more flexible design than SQL to apply to various RDBMS or NoSQL
How to use CLI & Jar to generate You can use the Homebrew package manager to install Liquibase on macOS.
1 2 brew install gcc brew install liquibase
or Download liquibase 4.3.5.tar.gz on download page .
I will use the jar file as an example in this article, the directory structure is as follows.
1 2 3 4 5 6 7 8 9 10 $ tree . ├── libs │ ├── commons-cli-1.4.jar │ ├── jaxb-api-2.3.0.jar │ ├── jaxb-core-2.3.0.jar │ ├── jaxb-impl-2.3.0.jar │ ├── liquibase.jar │ └── postgresql-42.2.20.jar └── liquibase.properties
The contents of liquibase.properties are as follows
1 2 3 4 5 6 7 changeLogFile: changelog-2021.0.0.xml url: jdbc:postgresql://localhost:5432/testdb?currentSchema=abc # schemas=abc username: postgres password: pw123456 classpath: libs/postgresql-42.2.20.jar logLevel: Info
Then execute the jar file
1 java -cp libs/liquibase.jar:libs/commons-cli-1.4.jar:libs/jaxb-api-2.3.0.jar:libs/jaxb-core-2.3.0.jar:libs/jaxb-impl-2.3.0.jar:libs/snakeyaml-1.27.jar liquibase.integration.commandline.Main generateChangeLog
Then you will get the file changelog-2021.0.0.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 <?xml version="1.1" encoding="UTF-8" standalone="no" ?> <databaseChangeLog xmlns ="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext ="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro ="http://www.liquibase.org/xml/ns/pro" xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation ="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.1.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd" > <changeSet author ="samzhu (generated)" id ="1623332621406-1" > <createTable remarks ="Questionnaire master file" tableName ="dtbga129" > <column autoIncrement ="true" name ="ser_no" remarks ="Serial number" type ="INTEGER" > <constraints nullable ="false" primaryKey ="true" primaryKeyName ="dtbga129_pkey" /> </column > <column name ="trn_id" remarks ="Transaction code" type ="VARCHAR(10)" /> <column name ="role" remarks ="rule" type ="JSON" /> <column name ="recommend" remarks ="Recommended products" type ="JSON" /> <column name ="input_date" remarks ="Enter date" type ="TIMESTAMP WITHOUT TIME ZONE" /> </createTable > </changeSet > </databaseChangeLog >
If you want to use SQL for management, you can modify liquibase.properties changeLogFile to .sql
1 2 3 4 5 6 7 changeLogFile: changelog-2021.0.0.sql url: jdbc:postgresql://localhost:5432/testdb?currentSchema=abc # schemas=abc username: postgres password: pw123456 classpath: libs/postgresql-42.2.20.jar logLevel: Info
try again generateChangeLog than get the changelog-2021.0.0.sql
1 2 3 4 5 6 7 8 9 10 CREATE TABLE "abc"."dtbga129" ("ser_no" INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL , "trn_id" VARCHAR (10 ), "role" JSON, "recommend" JSON, "input_date" TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT "dtbga129_pkey" PRIMARY KEY ("ser_no"));COMMENT ON TABLE "abc"."dtbga129" IS 'Questionnaire master file' ; COMMENT ON COLUMN "abc"."dtbga129"."ser_no" IS 'Serial number' ; COMMENT ON COLUMN "abc"."dtbga129"."trn_id" IS 'Transaction code' ; COMMENT ON COLUMN "abc"."dtbga129"."role" IS 'rule' ; COMMENT ON COLUMN "abc"."dtbga129"."recommend" IS 'Recommended products' ; COMMENT ON COLUMN "abc"."dtbga129"."input_date" IS 'Enter date' ;
Very easy to generate even you can use gradle or maven plugin to do automatic processing.
How to make a diff changelog Assuming that you make changes to the database in the development environment, you can generate a diff changelog by comparing the differences between the two databases.
liquibase.properties
1 2 3 4 5 6 7 8 9 10 11 12 13 14 changeLogFile : changelog-2021.1.0.xml url : jdbc:postgresql://localhost:5432/testdb?currentSchema=abc username : postgres password : pw123456 classpath : libs/postgresql-42.2.20.jar logLevel : Info referenceUrl : jdbc:postgresql://localhost:5432/testdb?currentSchema=dev referenceUsername : postgres referencePassword : pw123456
Then execute the jar file, but this time I use the diffChangeLog function.
1 java -cp libs/liquibase.jar:libs/commons-cli-1.4.jar:libs/jaxb-api-2.3.0.jar:libs/jaxb-core-2.3.0.jar:libs/jaxb-impl-2.3.0.jar:libs/snakeyaml-1.27.jar liquibase.integration.commandline.Main diffChangeLog
Then you will get the changelog-2021.1.0.xml file, which only describes the differences between the two databases.
Integrate with SpringBoot Install dependencies 1 2 3 4 dependencies { implementation 'org.liquibase:liquibase-core' runtimeOnly 'org.postgresql:postgresql' }
1 2 3 4 5 6 7 8 spring: datasource: driver-class-name: org.postgresql.Driver url: jdbc:postgresql://127.0.0.1:5432/testdb?currentSchema=dev username: postgres password: pw123456 liquibase: change-log: classpath:liquibase/master.xml
resources Springboot resources folder.
1 2 3 4 5 6 7 8 9 10 11 . ├── application.yml ├── liquibase │ ├── changelog │ │ ├── changelog-2021.0.0.xml │ │ └── changelog-2021.1.0.xml │ └── master.xml ├── static └── templates 4 directories, 4 files
Contents of master.xml
1 2 3 4 5 6 <?xml version="1.0" encoding="UTF-8" ?> <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 https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd" > <includeAll path ="liquibase/changelog/" relativeToChangelogFile ="false" /> </databaseChangeLog >
The includeAll tag can load all changelogs in a folder. If a single load can be used include.
path: specifies the location of the file or folder to be loaded
relativeToChangelogFile: Whether the path of the file location is relative to the root changelog, the default is false, that is, relative to the classpath.
Start springboot 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | ' _ | '_| | ' _ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.5.0) 2021-06-10 22:26:41.947 INFO 25361 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication using Java 11.0.9 on samzhude-MacBook-Pro.local with PID 25361 (/Users/samzhu/workspace/liquibase/spring/bin/main started by samzhu in /Users/samzhu/workspace/liquibase/spring) 2021-06-10 22:26:41.950 INFO 25361 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default 2021-06-10 22:26:42.540 INFO 25361 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2021-06-10 22:26:42.561 INFO 25361 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 JPA repository interfaces. 2021-06-10 22:26:43.062 INFO 25361 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2021-06-10 22:26:43.076 INFO 25361 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2021-06-10 22:26:43.076 INFO 25361 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.46] 2021-06-10 22:26:43.181 INFO 25361 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2021-06-10 22:26:43.181 INFO 25361 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1173 ms 2021-06-10 22:26:43.310 INFO 25361 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2021-06-10 22:26:43.444 INFO 25361 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2021-06-10 22:26:43.943 INFO 25361 --- [ main] liquibase.lockservice : Successfully acquired change log lock 2021-06-10 22:26:44.106 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/AbstractChangeLogHistoryService.class 2021-06-10 22:26:44.106 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogChild.class 2021-06-10 22:26:44.107 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogHistoryService.class 2021-06-10 22:26:44.107 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogHistoryServiceFactory$1.class 2021-06-10 22:26:44.107 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogHistoryServiceFactory.class 2021-06-10 22:26:44.107 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogInclude.class 2021-06-10 22:26:44.107 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogIncludeAll.class 2021-06-10 22:26:44.108 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogIterator$1.class 2021-06-10 22:26:44.108 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogIterator$2.class 2021-06-10 22:26:44.108 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogIterator.class 2021-06-10 22:26:44.108 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogParameters$1.class 2021-06-10 22:26:44.108 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogParameters$ChangeLogParameter.class 2021-06-10 22:26:44.108 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogParameters$ExpressionExpander.class 2021-06-10 22:26:44.109 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogParameters.class 2021-06-10 22:26:44.109 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeLogProperty.class 2021-06-10 22:26:44.109 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeSet$ExecType.class 2021-06-10 22:26:44.110 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeSet$RunStatus.class 2021-06-10 22:26:44.110 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeSet$ValidationFailOption.class 2021-06-10 22:26:44.110 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeSet.class 2021-06-10 22:26:44.110 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangeSetStatus.class 2021-06-10 22:26:44.110 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangelogRewriter$ChangeLogRewriterResult.class 2021-06-10 22:26:44.110 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/ChangelogRewriter.class 2021-06-10 22:26:44.110 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/DatabaseChangeLog$1.class 2021-06-10 22:26:44.111 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/DatabaseChangeLog.class 2021-06-10 22:26:44.111 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/IncludeAllFilter.class 2021-06-10 22:26:44.111 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/MockChangeLogHistoryService.class 2021-06-10 22:26:44.111 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/OfflineChangeLogHistoryService$1.class 2021-06-10 22:26:44.112 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/OfflineChangeLogHistoryService$2.class 2021-06-10 22:26:44.112 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/OfflineChangeLogHistoryService$3.class 2021-06-10 22:26:44.114 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/OfflineChangeLogHistoryService$4.class 2021-06-10 22:26:44.114 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/OfflineChangeLogHistoryService$5.class 2021-06-10 22:26:44.114 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/OfflineChangeLogHistoryService$Columns.class 2021-06-10 22:26:44.114 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/OfflineChangeLogHistoryService$ReplaceChangeSetLogic.class 2021-06-10 22:26:44.114 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/OfflineChangeLogHistoryService.class 2021-06-10 22:26:44.117 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/RanChangeSet.class 2021-06-10 22:26:44.117 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/RollbackContainer.class 2021-06-10 22:26:44.117 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/StandardChangeLogHistoryService.class 2021-06-10 22:26:44.117 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/column/LiquibaseColumn.class 2021-06-10 22:26:44.118 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/ActuallyExecutedChangeSetFilter.class 2021-06-10 22:26:44.118 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/AfterTagChangeSetFilter.class 2021-06-10 22:26:44.118 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/AlreadyRanChangeSetFilter.class 2021-06-10 22:26:44.119 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/ChangeSetFilter.class 2021-06-10 22:26:44.120 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/ChangeSetFilterResult.class 2021-06-10 22:26:44.120 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/ContextChangeSetFilter.class 2021-06-10 22:26:44.120 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/CountChangeSetFilter.class 2021-06-10 22:26:44.120 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/DbmsChangeSetFilter.class 2021-06-10 22:26:44.121 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/ExecutedAfterChangeSetFilter.class 2021-06-10 22:26:44.122 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/IgnoreChangeSetFilter.class 2021-06-10 22:26:44.123 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/LabelChangeSetFilter.class 2021-06-10 22:26:44.123 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/NotInChangeLogChangeSetFilter.class 2021-06-10 22:26:44.125 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/NotRanChangeSetFilter.class 2021-06-10 22:26:44.125 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/RanChangeSetFilter.class 2021-06-10 22:26:44.125 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/ShouldRunChangeSetFilter.class 2021-06-10 22:26:44.125 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/filter/UpToTagChangeSetFilter.class 2021-06-10 22:26:44.127 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/AbstractChangeExecListener.class 2021-06-10 22:26:44.127 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/ChangeExecListener.class 2021-06-10 22:26:44.127 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/ChangeLogSyncListener.class 2021-06-10 22:26:44.128 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/ChangeLogSyncVisitor.class 2021-06-10 22:26:44.130 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/ChangeSetVisitor$Direction.class 2021-06-10 22:26:44.131 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/ChangeSetVisitor.class 2021-06-10 22:26:44.131 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/DBDocVisitor$1.class 2021-06-10 22:26:44.131 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/DBDocVisitor$ChangeLogInfo.class 2021-06-10 22:26:44.132 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/DBDocVisitor.class 2021-06-10 22:26:44.132 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/DetermineNumberChangesFollowingVisitor.class 2021-06-10 22:26:44.132 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/ExpectedChangesVisitor.class 2021-06-10 22:26:44.132 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/ListVisitor.class 2021-06-10 22:26:44.134 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/LoggingChangeExecListener.class 2021-06-10 22:26:44.134 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/RollbackListVisitor.class 2021-06-10 22:26:44.134 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/RollbackVisitor.class 2021-06-10 22:26:44.134 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/SkippedChangeSetVisitor.class 2021-06-10 22:26:44.135 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/StatusVisitor.class 2021-06-10 22:26:44.135 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/UpdateVisitor.class 2021-06-10 22:26:44.135 INFO 25361 --- [ main] liquibase.changelog : Reading resource: /liquibase/changelog/visitor/ValidatingVisitor.class 2021-06-10 22:26:44.135 INFO 25361 --- [ main] liquibase.changelog : Reading resource: liquibase/changelog/changelog-2021.0.0.xml 2021-06-10 22:26:44.288 INFO 25361 --- [ main] liquibase.changelog : Reading resource: liquibase/changelog/changelog-2021.1.0.xml 2021-06-10 22:26:44.324 INFO 25361 --- [ main] liquibase.changelog : Creating database history table with name: abc.databasechangelog 2021-06-10 22:26:44.343 INFO 25361 --- [ main] liquibase.changelog : Reading from abc.databasechangelog 2021-06-10 22:26:44.408 INFO 25361 --- [ main] liquibase.lockservice : Successfully released change log lock 2021-06-10 22:26:44.421 INFO 25361 --- [ main] liquibase.lockservice : Successfully acquired change log lock Skipping auto-registration 2021-06-10 22:26:44.424 WARN 25361 --- [ main] liquibase.hub : Skipping auto-registration 2021-06-10 22:26:44.462 INFO 25361 --- [ main] liquibase.changelog : Table dtbga129 created 2021-06-10 22:26:44.466 INFO 25361 --- [ main] liquibase.changelog : ChangeSet liquibase/changelog/changelog-2021.0.0.xml::1623332621406-1::samzhu (generated) ran successfully in 37ms 2021-06-10 22:26:44.530 INFO 25361 --- [ main] liquibase.changelog : Table dtbga130 created 2021-06-10 22:26:44.534 INFO 25361 --- [ main] liquibase.changelog : ChangeSet liquibase/changelog/changelog-2021.1.0.xml::1623333952699-7::samzhu (generated) ran successfully in 50ms 2021-06-10 22:26:44.545 INFO 25361 --- [ main] liquibase.lockservice : Successfully released change log lock 2021-06-10 22:26:44.664 INFO 25361 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2021-06-10 22:26:44.719 INFO 25361 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.31.Final 2021-06-10 22:26:44.868 INFO 25361 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2021-06-10 22:26:44.986 INFO 25361 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect 2021-06-10 22:26:45.197 INFO 25361 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2021-06-10 22:26:45.211 INFO 25361 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit ' default' 2021-06-10 22:26:45.279 WARN 25361 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2021-06-10 22:26:45.644 INFO 25361 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ' ' 2021-06-10 22:26:45.654 INFO 25361 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 4.312 seconds (JVM running for 4.714) 2021-06-10 22:26:45.655 INFO 25361 --- [ main] o.s.b.a.ApplicationAvailabilityBean : Application availability state LivenessState changed to CORRECT 2021-06-10 22:26:45.656 INFO 25361 --- [ main] o.s.b.a.ApplicationAvailabilityBean : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
Completion!
Reference Get Started with Liquibase Comparing Two States of the Same Database Schema liquibase集成springboot使用步骤 Managing Database migrations with Liquibase and Spring Boot Getting Started with Liquibase