I need advice on how to do this…
I want to use a precondition to check if a column exists. The column is created and defaulted to NULL.
Ideally, I’d use the columnExists precondition, but I’d need to know my DB’s schema. It’s possible that there might be multiple schemas in this DB, so is there a way to dynamically reference the one that liquibase is currently connected to?
Otherwise, I could use the sqlCheck precondition, but I don’t know what my expectedResult should be. I really need the expected result to be 0 or greater, because of the null values as default, but is there a way to specify that? Is there a way to catch the “Invalid column name” exception that a DB will throw if I attempt to run a select count(column) on a column that doesn’t exist?