Liquibase Java API DBMS 不匹配

问题描述 投票:0回答:0

我正在尝试将 Liquibase 集成到 Java Spring 应用程序中,以根据从我的应用程序堆栈中的其他位置传入的连接字符串来管理数据库。基本上我已经在别处管理了更新脚本和连接字符串,我只是在构建一个应用程序来执行 Liquibase 更新。

我遇到的问题是我所有的变更集都被跳过了。我在 Liquibase 库的 Java 文档中可以找到尽可能多的 Liquibase 结果输出,但我所看到的可能是错误的如下:

DBMS mismatch (dbmsMismatch): Database 'mysql' matches all databases

我在任何地方的 Liquibase 文档中都找不到任何相关信息。

liquibase.update()
updateWriter 的输出如下:

1 changesets have not been applied to <username>@<hostname>@jdbc:mysql:@<hostname>:<port>/<db_name>
     v1.03__scheduler_test_updates.sql::3::author

这正确地引用了我希望运行的变更集,但没有给我任何关于为什么它没有被应用的信息。

最好的部分是,我有一个不同版本的应用程序,使用更旧版本的 Java Spring 和 Liquibase,效果很好。我正在尝试将所有内容升级到更新版本,因为我需要添加更强大的日志记录和通知,然后才能为生产环境做好准备。

我在这里包含了变更集文件的全部内容:

--liquibase formatted sql

--changeset author:1 labels:ad_hoc__testing
ALTER TABLE `test-new-table` ADD COLUMN `isManager` tinyint(1) DEFAULT 0;

--changeset author:2 labels:ad_hoc__testing
INSERT INTO `test-new-table` (`name`, `description`) VALUES ("First Entry", "This is the first entry in the table.");

--changeset author:3 labels:ad_hoc__testing
INSERT INTO `test-new-table` (`name`, `description`, `isManager`) VALUES ("Second Entry", "This is the second entry in the table.", 1);
mysql liquibase
© www.soinside.com 2019 - 2024. All rights reserved.