[英]Liquibase coming with Spring Boot handles the database well with changelog.xml. How can it generate its sql at the same time?
I'm using the default Liquibase configuration coming with Spring Boot .我使用的是Spring Boot附带的默认Liquibase配置。
I have:我有:
changelog.xml
file in src/main/resources/db/changelog
that works fine, src/main/resources/db/changelog
中的changelog.xml
文件工作正常,url
, changeLogFile
, driver
, username
, password
properties in application.properties
,url
、 changeLogFile
、 driver
、 username
、 application.properties
中的password
属性,pom.xml
having this for <dependency>
and <dependencyManagement>
:pom.xml
有这个<dependency>
和<dependencyManagement>
: <dependencies>
...
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<configuration>
<promptOnNonLocalDatabase>true</promptOnNonLocalDatabase>
<propertyFile>${project.basedir}/../ApplicationMetierEtGestion/src/main/resources/application.properties</propertyFile>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Aside from the update of the database structure led by changelog.xml
that is working fine at development time, I would like Liquibase to generate also the related SQL files (by the mean of its updateSQL command).除了在开发时运行良好的由
changelog.xml
领导的数据库结构更新之外,我希望Liquibase还生成相关的SQL文件(通过其 updateSQL 命令)。
This, because the next environments might not have Liquibase to handle the database updates.这是因为下一个环境可能没有Liquibase来处理数据库更新。
How can I do that from here?我怎么能从这里做到这一点?
Liquibase has a goal that generates this SQL for you which is called updateSQL. Liquibase 的目标是为您生成这个 SQL,称为 updateSQL。
Have a look as it might be interesting in your case.看看你的情况可能会很有趣。
https://docs.liquibase.com/tools-integrations/maven/commands/maven-updatesql.html https://docs.liquibase.com/tools-integrations/maven/commands/maven-updatesql.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.