Applies to:
- Liquibase Pro
Conditions:
- Liquibase Pro version 4.3.0 or greater
Question:
Can Policy Checks be used to check SQL? For example, can a Policy check be used to verify that there isn't a CREATE statement in the SQL file?
Answer:
Yes, this is possible by using the SqlUserDefinedPatternCheck, and this check can be customized.
A guide can be found at Liquibase Pro – Add Custom Policy Checks, to look for any user-defined pattern. This pattern can either be a STRING or a regex (regular expression).
We have a public Github repository, custom_policychecks, with various custom Policy checks that have been created that can be used as a starting point.
Comments
0 comments
Article is closed for comments.