liquibase databasechangelog table in updateSql mode

杀马特。学长 韩版系。学妹 提交于 2019-12-25 00:17:50

问题


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.


回答1:


There is a way to include the databasechangelog table by using the outputLiquibaseSql parameter in the url

.\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

This causes sometimes trouble with CMD or PowerShell (because of the questionmark) so it can be helpful to include it in the liquibase.properties file.




回答2:


You need to change the URL you are using to a non-offline version.



来源:https://stackoverflow.com/questions/52335076/liquibase-databasechangelog-table-in-updatesql-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!