在现有架构上使用 liquibase
我读过有关如何从现有架构生成changelog.xml 的内容。没关系,但我不想触及现有的系统,除非引入新的更改。我还有全新的系统,需要应用所有更改。
因此,我想让 liquibase 在现有系统上运行时仅执行变更集 X 的迁移。即该系统的数据库处于修订版 X-1(但没有 liquibase sys 表),并且我不希望应用任何先前的迁移。
非常感谢, 拍
I've read about how you can generate changelog.xml from an existing schema. That's fine, but I have existing systems that I don't want to touch, except to bring in new changes. I also have completely new systems which require all changes be applied.
So, I want to get liquibase to only perform migrations from changeset X when running on an existing system. I.e. that system's DB is at revision X-1 (but no liquibase sys tables), and I don't want any preceeding migrations applied.
Many thanks,
Pat
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议采用稍微不同的方法,如 Liquibase 论坛帖子
I would recommend a slightly different approach, as commented in this Liquibase forum thread
我认为最简单的方法是首先在空数据库上执行初始设置,然后导出 liquibase 插入到 DATABASECHANGELOG 表中的条目。然后,我导出这些条目并将它们手动插入到目标数据库之一的 DATABASECHANGELOG 表中,这样 liquibase 就不会再次执行“更改”。
当然,我会在测试机器上使用测试转储来测试所有这些...:)
I think the easiest would be to execute the initial setup on an empty database at first and export the entry(ies) liquibase does insert into the
DATABASECHANGELOG
table. Then I'd export these entries and insert them manually into one of the target databases into theirDATABASECHANGELOG
table, so liquibase does not execute the "change" there again.Of course I'd test all that with test dumps on a test machine... :)