1

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.

15:39:35 SEVERE 1/29/20 10:39 PM: liquibase: changelogs/catalog/catalog.db.changelog-2019.Q2.R1.xml::US122742.17::vrodrigu: File does not exist: 'functions/update_daily_take_ingest_date_func.sql'

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!

4

1 回答 1

1

最佳实践是编写另一个更改集,在其中删除函数并将其作为新文件添加到项目中。

ChangeLogs 和 changeSets 应该是不可变的。这个想法是类 Liquibase 工具的基石之一。您应该只添加新的更改集来更改现有的数据库结构(即使您添加的更改集删除了某些内容)。

因此,更改或删除现有的 changeSet(或 changeLog 文件)与最佳实践相反

于 2020-01-30T06:48:45.617 回答