Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Re : Precondition to Check Whether Column is Nullable

$
0
0
There isn't a built-in precondition that will check that, but you could either use the <sqlCheck> precondition and query the metadata tables in the check, or write your own extension that can check nullability without needing a constraint name.  

liquibase.org/extensions has some documentation on writing an extension. The advantage with an extension is that then you don't need to keep writing the SQL in each precondition and can use the liquibase snapshot java APIs to get at the metadata without figuring out the SQL.

If you wanted to send a pull request for a new precondition in the main liquibase code, I would certainly look at incorporating it as well.

nathan

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>