本文介绍了在updateSql模式下的liquibase databasechangelog表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从变更日志文件中生成SQL文件时,数据库变更日志表在与生成的SQL文件相同的文件夹中创建为CSV文件,但我希望将其作为SQL文件中的表.我使用liquibase 3.5.5.通过命令行并使用了以下命令:

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

我没有找到在SQL文件中集成databasechangelog表的命令.仅当我使用update语句而不是updatesql但需要SQL文件时,它才集成.

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.

推荐答案

有一种方法可以通过在URL中使用outputLiquibaseSql参数来包括databasechangelog表

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

这有时会导致CMD或PowerShell出现问题(由于问号),因此将其包含在liquibase.properties文件中会很有帮助.

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.

这篇关于在updateSql模式下的liquibase databasechangelog表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 13:02