问题标签 [liquibase-sql]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
936 浏览

liquibase - Liquibase 对 sql 中所有更改日志文件的先决条件

我想对我的 SQL changeLogFile 中的每个 changeSet 运行 SQL 前置条件检查。它实际上是changeLog本身的前提条件

这是它的摘录:

即使实际上不遵守前提条件,liquibase 仍会运行所有变更集。

有人知道这是否是我这边的错误,还是 liquibase 不允许对 SQL changeLog 文件的整个 changeLog 设置先决条件?

提前致谢 !

0 投票
1 回答
86 浏览

java - 我们可以使用 Liquibase 监控数据库表中新添加的数据吗?

我想使用 Liquibase 监视数据库表中新添加的数据。我发现我们可以对表执行创建、插入、更新、删除、回滚类型的操作,但我不确定我们是否可以执行读取操作来查看实际数据。

0 投票
0 回答
616 浏览

spring-boot - JHipster 在不使用初始模式的情况下创建新表实体

我最近开始使用 JHipster。我在创建新表时遇到问题(提供的 jhipster 除外)。JHipster 通过 00000000000000_initial_schema.xml 提供他们的表,即使同一个表具有实体 java 类。

但是现在我创建了新的@Entity 类,但没有创建表。需要做哪些改变?

还有一件事要问,我们如何完全禁用初始模式并从实体类生成表,即使对于现有的 jhi_* 表

提前致谢 :)

0 投票
1 回答
682 浏览

liquibase - liquibase sqlFile complains that "File does not exist"

So, a while back I moved all of our database functions and view to individual files for better change control. Today, I deleted a function and therefore I deleted the file for that function. However, the original changeLog from 2019.Q2.R1 still references the file and liquibase complains that the file does not exist now.

We are following the best practice recommended by liquibase where we have a master changelog file that then includes all of changelog files, one for each new release. The file I deleted is still referenced by an old changelog file catalog.db.changelog-2019.Q2.R1.xml, which as the name implies is from Q2 of last year.

What is the best practice in these situations? Should a file referenced by old sqlFile elements just never be deleted? Should I go back to the old references and eliminate those references? The latter would be changing history and someone looking at that old changelog file wouldn't be the wiser. Is there a flag or attribute I can put on my changelogs so that they don't complain about the file not existing if it's deleted in the future?

Not sure what the best approach is. Thanks in advance for your help!

0 投票
1 回答
1799 浏览

database-migration - 了解 liquibase 中logicalFilePath 的行为

我的一个变更集有一个不正确的逻辑文件路径(两个变更集意外具有相同的逻辑文件路径),并且在现有变更集中编辑逻辑文件路径时,liquibase 更新失败并出现重复列错误,这意味着 liquibase 认为变更集不是执行并重新运行它。

liquibase 是否根据“已执行”标志或“id”、“作者”和“逻辑文件路径”的组合来识别变更集是否已被执行?

另外,在现有变更集的逻辑文件路径不正确的情况下,我该如何纠正错误

0 投票
1 回答
78 浏览

jenkins - 如何仅在控制台上显示 diffChangeLog 命令的输出?

我正在研究用于数据库模式版本控制的 Liquibase 命令。目前我正在使用diffChangeLog命令。下面是我正在处理的示例格式。

根据我的要求,我不希望结果保存在 dbchangelog.xml 上。我只想在控制台上得到这个结果。是否必须传递changeLogFile参数,因为如果我不传递,则diffChangeLog命令不起作用。请帮忙。

0 投票
1 回答
1989 浏览

csv - Liquibase CSV loadData 失败,带引号的字符串包含逗号

我正在尝试使用 Liquibase 更改日志集将 CSV 文件加载到 SQLserver 表中。当将 XLSX 文件保存为 CSV 文件时,包含逗号的列保存在双引号中(请参见下面的第三个值),按照标准这很好,但 liquibase 忽略双引号并考虑双引号内的逗号。

13,OV,糖尿病门诊自我管理培训服务个体,每30分钟”,77.82,1,0,1/4/2016,,G0108

来自命令行终端的错误消息:


CSV 文件 v2.1/r21/TestData20212021.csv 第 21 行定义了 10 个值,标题有 9 个。数字必须相等(检查带有嵌入逗号的未引用字符串)


0 投票
2 回答
958 浏览

oracle - Liquibase 忽略 Oracle DB 的 autoIncrement="true"

我通过 Hibernate 生成的 DDL 生成了一个模式/表,这是正确的:

之后,我尝试生成如下所示的 Liquibase 更改日志:

问题是,如果我尝试运行 liquibase 更改日志,它会将 XML 定义转换为:

2020-02-26 16:15:10.787 INFO 8064 --- [main] liquibase.changelog.ChangeSet:表组织创建于 2020-02-26 16:15:10.787 INFO 8064 --- [main] liquibase.changelog.ChangeSet : ChangeSet classpath:/db/changelog/db.changelog-master.xml::1582733383680-5::blabla (generated) 在 9ms 内成功运行

您可能已经注意到,缺少“作为身份生成”,这让我相信无论出于何种原因,autoIncrement="true" 都会被忽略。

我使用 Oracle 12.1.0.2 和 org.liquibase:liquibase-core 3.8.2。OJDBC 驱动程序版本为 19.3.0.0。gradle 属性是:

我上网看了,知道我的Oracle版本是兼容这种列类型的,不需要创建额外的oracle Sequences。任何线索可能是什么问题?

0 投票
2 回答
363 浏览

liquibase - 我可以禁止创建 DatabaseChangeLogLock 表吗?

我有一个模式(适用于应用程序用户),其中只有一个脚本(创建同义词)运行。我没有该架构的 INSERT/UPDATE/CREATE 权限。我可以禁止在该模式中创建审计表(即 DATABASECHANGELOGLOCK 和 DATABASECHANGELOG 表)吗?如果是,我该怎么做?

另外,有人可以告诉我,当第一次部署完成时,代码如何以及在哪里识别这些审计表是第一次在模式中创建的?请帮忙。

0 投票
3 回答
2553 浏览

jenkins - 无法读取架构文档“http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd”

我已经在 J​​enkins 中安装了 Liquibase runner 1.3.0 插件,并尝试执行我在执行“diffChangeLog”命令后得到的 liquibase 更改日志脚本文件。在执行脚本文件时,我收到Failed to read schema document ' http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd '作为异常。我检查了我的变更日志文件,它有下面提到的标题。

但是现在在这里,当我在标题中的两个位置将“3.8”替换为“3.5”时,它就会成功执行。我希望仅使用“3.8”执行此操作。请帮忙。