sql - liquibase databasechangelog table in updateSql mode
问题描述
When I generate a SQL file out of my changelog file the databasechangelog table is created as a CSV file in the same folder as my generated SQL file but I want it as a table inside of my SQL file. I use liquibase 3.5.5. via command line and used this command:
.\liquibase --url=offline:mssql? `
--changeLogFile="C:\Users\Ferid\Documents\Box Sync\PRIVATE_Ferid\liquibase-3.5.5-bin\Changelog.xml" `
--outputFile="C:\Users\Ferid\Documents\Box Sync\PRIVATE_Ferid\liquibase-3.5.5-bin\all.sql" `
updatesql
I did not find a command which integrates the databasechangelog table in the SQL file. It is only integrated when I use the update
statement instead of updatesql
but I need the SQL file.
解决方案
有一种方法可以通过使用outputLiquibaseSql
url 中的参数来包含 databasechangelog 表
.\liquibase --url=offline:mssql?outputLiquibaseSql=true `
--changeLogFile="C:\Users\Ferid\Documents\Box Sync\PRIVATE_Ferid\liquibase-3.5.5-bin\Changelog.xml" `
--outputFile="C:\Users\Ferid\Documents\Box Sync\PRIVATE_Ferid\liquibase-3.5.5-bin\all.sql" `
updatesql
这有时会导致 CMD 或 PowerShell 出现问题(因为问号),因此将其包含在 liquibase.properties 文件中会很有帮助。
推荐阅读
- python - Python apyori 似乎误判了支持和提升
- nginx - Nginx 将请求转发到不同的端口
- jenkins - 需要在 groovy 的 post 请求中将变量值传递给 json 主体 - Jenkins
- python - Python webscraper 点击 xbrl 链接
- sql - 查询以确定从用户注册到第一次购买的平均持续时间
- django - Django:插入多个输入文本和文件
- c - 用于自定义打印函数的可变参数宏,在 C 中具有参数扩展
- mediawiki - 在 Wikidata API 中执行全文搜索时检索 Wikipedia 页面标题
- javascript - 有人玩游戏时如何自动分配角色?V12 不和谐 js
- python - 如何使用 matplot lib 和 python 绘制和保存单独的图