Is there any solution for DB entity dependency handling

Hi,

Some DB entities have dependencies. e.g a view / stored procedure depends on views / tables it uses. Is there a way to handle it with xml changelog?

In my scenario ViewB uses ViewA. To change ViewA steps required:

  1. ViewB needs to be dropped.
  2. ViewA needs to be changed
  3. ViewB needs to be recreated
I have the following changesets:

dropView should have an option 'ifExists' avoiding error if the view does not exists

  • dropView could have an option to drop all dependent objects. (The dependency can be retrieved from the DB.)
  • Some way to call or ask another changeSet to be executed later. In that case if a dependent view (ViewA) has been changed. The changeset drops the depending view(s) (ViewB) and ask liquibase to execute the changesets recreating it. This feature could be used in many other cases. liquibase only needs to change the flag if a changeSet needs to be executed.
  • Similar: changeSet could have a 'dependsOn' option listing the changesets it depends on. If the depended changeset was executed, execute this also even if not changed
  • precondition similar to changeSetExecuted (or just a option) to check if a changeSet was executed in the current execution.
  • Possibility to change the value of a property within a changeSet. (Opens enormous number of possibilities and flexibility)
  • Thanks,

        Gyula Bibernáth

    1 Like

    Hello, @GyulaBibernth - Thanks for posting.

    I’ve been doing a little housekeeping, and I came across this post. In the time since you created it, we’ve added an Idea board for people to use to make improvement suggestions. If these are still ideas that you would like to see come to Liquibase that haven’t already, you can now add them at https://ideas.liquibase.com

    Thanks,
    Tabby