spring_reference/IX. ‘How-to’ guides/68.5.2. Execute Liquibase d...

8 lines
762 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 68.5.2. 启动时执行Liquibase数据库迁移
想要在启动时自动运行Liquibase数据库迁移你需要将`org.liquibase:liquibase-core`添加到classpath下。
主改变日志master change log默认从`db/changelog/db.changelog-master.yaml`读取,但你可以使用`liquibase.change-log`进行设置。详情查看[LiquibaseProperties](http://github.com/spring-projects/spring-boot/tree/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java)以获取可用设置比如上下文默认的schema等。
这里有个[Liquibase示例](http://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-liquibase)可作为参考。