首页 > 解决方案 > 用于在 yaml 中生成脚本的 Liquibase 命令

问题描述

当我尝试在 yaml 中生成 liquibase 脚本时,我得到了这个错误:

liquibase.exception.LiquibaseException:liquibase.command.CommandExecutionException:java.lang.RuntimeException:没有序列化程序与 liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:282) 的文件名或扩展名“changelogs/.struct.yaml”相关联) ~[liquibase.jar:na] 在 liquibase.integration.commandline.Main.doMigration(Main.java:1060) [liquibase.jar:na] 在 liquibase.integration.commandline.Main.run(Main.java:209) [liquibase.jar:na] 在 liquibase.integration.commandline.Main.main(Main.java:132) [liquibase.jar:na]

这是我使用的命令:

liquibase  --driver=com.mysql.jdbc.Driver  
--changeLogFile=changelogs/.struct.yaml 
--classpath=libs/mysql-connector-java-8.0.11.jar 
--url="jdbc:mysql://127.0.0.1:32306/test?user=root&password=somepassword&useUnicode=true&characterEncoding=utf8"  
--username=root  
--password=somepassword
generateChangeLog 

我也添加了snakeyaml-1.25.jar。我正在使用 mysql 在 mac 上运行。我使用 brew install 安装了 liquibase。

标签: mysqlliquibase

解决方案


您的文件名以点开头:

--changeLogFile=changelogs/.struct.yaml

将其更改为类似db.struct.yamlstruct.yaml


推荐阅读