I’ve just taken over an old project. It is using liquibase 3.5.3 against Oracle Enterprise 19c.
There are <sql>
tags all over the place, even where there is a specific XML tag to do the job!
However, a very common pattern is this:
<changeSet ...>
<createTable tableName="XX" ...
</changeSet>
<changeSet ...>
<sql>
grant select on XX to some_user
</sql>
</changeSet>
If I run a dropAll and then update, it will always fail on the grant, complaining that the table does not exist. If I then run update again, it will succeed. Because this happens throughout the (very large) changelog, I have to run update many times.
As a test, I have changed some <sql>
tags that were failing into the equivalent XML tags and they then work. But I cannot change every <sql>
tag since there are some things that cannot be done that way. However, this seems to confirm that it is caused by an <sql>
tag operating on something that was just created by a “regular” XML tag. I have tested this with index rebuilds, datatype changes and null constraints. It doesn’t matter whether the <sql>
is in the same changeset or a different one.
I am also told by a colleague, that this does not happen when running the same changelog against a different schema. I can’t test that just at the moment because I don’t have loads of spare schemas around.
Before I spend a lot of time creating a test rig, does this sound familiar to anyone?
If my colleague is correct, it is probably a setting on the schema. But what to look for?! If he is mistaken, then is it a known bug in liquibase 3.5.3?